summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_recycle.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-13 17:41:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:12 -0500
commit1a60c450dd83166fb1a1a8e83c2dc57e2e77b2cc (patch)
tree6b31ea9ee2142393b78ef6980f66c94c3a37f76e /source3/modules/vfs_recycle.c
parent9625ed4a36cadfe5901ecf97935c75f0471badd5 (diff)
downloadsamba-1a60c450dd83166fb1a1a8e83c2dc57e2e77b2cc.tar.gz
samba-1a60c450dd83166fb1a1a8e83c2dc57e2e77b2cc.tar.bz2
samba-1a60c450dd83166fb1a1a8e83c2dc57e2e77b2cc.zip
r7542: Patch from Renaud Duhaut <rd@duhaut.com> for a parameter
"directory_mode" when creating recycle directories. Bug #1040. Jeremy. (This used to be commit 1c94cbd72d93ff8f17d6e1971ff984fa9581f1ce)
Diffstat (limited to 'source3/modules/vfs_recycle.c')
-rw-r--r--source3/modules/vfs_recycle.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index 5ff7931c58..6a9914131d 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -153,6 +153,23 @@ static int recycle_maxsize(vfs_handle_struct *handle)
return maxsize;
}
+static mode_t recycle_directory_mode(vfs_handle_struct *handle)
+{
+ mode_t dirmode;
+ const char *buff;
+
+ buff = lp_parm_const_string(SNUM(handle->conn), "recycle", "directory_mode", NULL);
+
+ if (buff != NULL ) {
+ sscanf(buff, "%o", (int *)&dirmode);
+ } else {
+ dirmode=S_IRUSR | S_IWUSR | S_IXUSR;
+ }
+
+ DEBUG(10, ("recycle: directory_mode = %o\n", dirmode));
+ return dirmode;
+}
+
static BOOL recycle_directory_exist(vfs_handle_struct *handle, const char *dname)
{
SMB_STRUCT_STAT st;
@@ -213,7 +230,7 @@ static BOOL recycle_create_dir(vfs_handle_struct *handle, const char *dname)
char *tok_str;
BOOL ret = False;
- mode = S_IRUSR | S_IWUSR | S_IXUSR;
+ mode = recycle_directory_mode(handle);
tmp_str = SMB_STRDUP(dname);
ALLOC_CHECK(tmp_str, done);