r15909: Implement recycle:subdir_mode
authorVolker Lendecke <vlendec@samba.org>
Sat, 27 May 2006 16:55:30 +0000 (16:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:17:12 +0000 (11:17 -0500)
(This used to be commit 4dd8694a250e4d064a790fe8f422c965ab533880)

source3/modules/vfs_recycle.c

index 7b2b15171e441d3913bde6218a40ef2524fe88c2..42f2f51416ee3f57c85d36ec489dc069c7ee4031 100644 (file)
@@ -181,6 +181,23 @@ static mode_t recycle_directory_mode(vfs_handle_struct *handle)
        return (mode_t)dirmode;
 }
 
+static mode_t recycle_subdir_mode(vfs_handle_struct *handle)
+{
+       int dirmode;
+       const char *buff;
+
+       buff = lp_parm_const_string(SNUM(handle->conn), "recycle", "subdir_mode", NULL);
+
+       if (buff != NULL ) {
+               sscanf(buff, "%o", &dirmode);
+       } else {
+               dirmode=recycle_directory_mode(handle);
+       }
+
+       DEBUG(10, ("recycle: subdir_mode = %o\n", dirmode));
+       return (mode_t)dirmode;
+}
+
 static BOOL recycle_directory_exist(vfs_handle_struct *handle, const char *dname)
 {
        SMB_STRUCT_STAT st;
@@ -270,6 +287,7 @@ static BOOL recycle_create_dir(vfs_handle_struct *handle, const char *dname)
                        }
                }
                safe_strcat(new_dir, "/", len);
+               mode = recycle_subdir_mode(handle);
        }
 
        ret = True;