diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-12-24 16:37:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:43 -0500 |
commit | e8e5c17f2e5c09dff5b2acaaab9a9659b9242c6f (patch) | |
tree | b949938667fe64aecdefe533f191a55359c3b699 /source3/smbd | |
parent | a67757ef9c6ed421341fe948d93aff94991da053 (diff) | |
download | samba-e8e5c17f2e5c09dff5b2acaaab9a9659b9242c6f.tar.gz samba-e8e5c17f2e5c09dff5b2acaaab9a9659b9242c6f.tar.bz2 samba-e8e5c17f2e5c09dff5b2acaaab9a9659b9242c6f.zip |
r20344: Move the calls to inherit_access_acls and change_owner_to_parent together.
Jeremy, I'm 100% sure you watch me closely here, I count on you :-)
Volker
(This used to be commit 02f85265f21607c950639da33bc8fe5d5ffd3cf9)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/open.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c3df5acde3..59cd8030af 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -293,11 +293,17 @@ static NTSTATUS open_file(files_struct *fsp, return map_nt_error_from_unix(errno); } - /* Inherit the ACL if the file was created. */ - if ((local_flags & O_CREAT) - && !file_existed - && lp_inherit_perms(SNUM(conn))) { - inherit_access_acl(conn, fname, unx_mode); + if ((local_flags & O_CREAT) && !file_existed) { + + /* Inherit the ACL if required */ + if (lp_inherit_perms(SNUM(conn))) { + inherit_access_acl(conn, fname, unx_mode); + } + + /* Change the owner if required. */ + if (lp_inherit_owner(SNUM(conn))) { + change_fd_owner_to_parent(conn, fsp); + } } } else { @@ -1702,10 +1708,6 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, } } else { info = FILE_WAS_CREATED; - /* Change the owner if required. */ - if (lp_inherit_owner(SNUM(conn))) { - change_fd_owner_to_parent(conn, fsp); - } } if (pinfo) { @@ -1913,6 +1915,11 @@ static NTSTATUS mkdir_internal(connection_struct *conn, const char *name, psbuf->st_mode | (mode & ~psbuf->st_mode)); } + /* Change the owner if required. */ + if (lp_inherit_owner(SNUM(conn))) { + change_owner_to_parent(conn, name, psbuf); + } + return NT_STATUS_OK; } @@ -2086,11 +2093,6 @@ NTSTATUS open_directory(connection_struct *conn, TALLOC_FREE(lck); - /* Change the owner if required. */ - if ((info == FILE_WAS_CREATED) && lp_inherit_owner(SNUM(conn))) { - change_owner_to_parent(conn, fsp->fsp_name, psbuf); - } - if (pinfo) { *pinfo = info; } |