diff options
author | Jeremy Allison <jra@samba.org> | 2012-01-10 13:49:03 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-01-23 21:30:39 +0100 |
commit | 5effeb2fa6a4f293a1c45b80496b30d76539be80 (patch) | |
tree | 19b4fd08ef6a6b1a98f61a679e1d334694de9caa | |
parent | 713e10664603c9f38dabe65c8b380e7acc90d294 (diff) | |
download | samba-5effeb2fa6a4f293a1c45b80496b30d76539be80.tar.gz |
Third part of fix for bug #8673 - NT ACL issue.
(Not needed in master as this code has changed). Ensure we set a temp
access mask before calling open(O_RDONLY|O_DIRECTORY) on the directory.
(cherry picked from commit 6b72809b7488cc530f47ad08dfde215627681cf6)
-rw-r--r-- | source3/smbd/open.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index ce86b4caf2e..202643f61e4 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2740,10 +2740,6 @@ static NTSTATUS open_directory(connection_struct *conn, fsp->share_access = share_access; fsp->fh->private_options = 0; - /* - * According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted, - */ - fsp->access_mask = access_mask | FILE_READ_ATTRIBUTES; fsp->print_file = NULL; fsp->modified = False; fsp->oplock_type = NO_OPLOCK; @@ -2758,6 +2754,8 @@ static NTSTATUS open_directory(connection_struct *conn, mtimespec = smb_dname->st.st_ex_mtime; + /* Temporary access mask used to open the directory fd. */ + fsp->access_mask = FILE_READ_DATA | FILE_READ_ATTRIBUTES; #ifdef O_DIRECTORY status = fd_open(conn, fsp, O_RDONLY|O_DIRECTORY, 0); #else @@ -2773,6 +2771,12 @@ static NTSTATUS open_directory(connection_struct *conn, return status; } + /* + * According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted, + * Set the real access mask for later access (possibly delete). + */ + fsp->access_mask = access_mask | FILE_READ_ATTRIBUTES; + status = vfs_stat_fsp(fsp); if (!NT_STATUS_IS_OK(status)) { fd_close(fsp); |