diff options
author | Jeremy Allison <jra@samba.org> | 2002-03-11 21:57:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-03-11 21:57:12 +0000 |
commit | db4c62d7ed2eb5503927edf7e25c5a2fc94f4174 (patch) | |
tree | 9268354ba8661b6af4b459595790e9dd490cfa7b /source3/smbd/vfs-wrap.c | |
parent | 3bc38669efda51f754890474298b9d59f060724d (diff) | |
download | samba-db4c62d7ed2eb5503927edf7e25c5a2fc94f4174.tar.gz samba-db4c62d7ed2eb5503927edf7e25c5a2fc94f4174.tar.bz2 samba-db4c62d7ed2eb5503927edf7e25c5a2fc94f4174.zip |
Implemented default ACL patch (set inherit acls = true on a per share basis).
Based on code donated by Olaf Frączyk <olaf@cbk.poznan.pl>. Further commit
will change to sending via vfs interface.
Jeremy.
(This used to be commit d85133e2697eb22f1573c78447b57791ae63dd6b)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r-- | source3/smbd/vfs-wrap.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c index bb7d497274..78c6fb3905 100644 --- a/source3/smbd/vfs-wrap.c +++ b/source3/smbd/vfs-wrap.c @@ -94,19 +94,23 @@ struct dirent *vfswrap_readdir(connection_struct *conn, DIR *dirp) int vfswrap_mkdir(connection_struct *conn, const char *path, mode_t mode) { - int result; + int result; + BOOL has_dacl = False; - START_PROFILE(syscall_mkdir); + START_PROFILE(syscall_mkdir); #ifdef VFS_CHECK_NULL - if (path == NULL) { - smb_panic("NULL pointer passed to vfswrap_mkdir()\n"); - } + if (path == NULL) { + smb_panic("NULL pointer passed to vfswrap_mkdir()\n"); + } #endif - result = mkdir(path, mode); + if (lp_inherit_acls(SNUM(conn)) && (has_dacl = directory_has_default_acl(parent_dirname(path)))) + mode = 0777; + + result = mkdir(path, mode); - if (result == 0) { + if (result == 0 && !has_dacl) { /* * We need to do this as the default behavior of POSIX ACLs * is to set the mask to be the requested group permission |