diff options
author | Volker Lendecke <vl@samba.org> | 2011-12-16 18:45:14 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-01-03 13:38:01 +0100 |
commit | 8cadd19a91cc4cded493b9ba5dec821f93dcfb54 (patch) | |
tree | 28ff8f748480009a1529181dcf505a4c204ad2c6 /source3/smbd | |
parent | a5a4b581b7b428621da5477994f0413443fa6bcb (diff) | |
download | samba-8cadd19a91cc4cded493b9ba5dec821f93dcfb54.tar.gz samba-8cadd19a91cc4cded493b9ba5dec821f93dcfb54.tar.bz2 samba-8cadd19a91cc4cded493b9ba5dec821f93dcfb54.zip |
s3: Directly use *p_access_mask in smbd_calculate_maximum_allowed_access
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/open.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 818dceb050..6d7b634bbb 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1482,11 +1482,10 @@ static NTSTATUS smbd_calculate_maximum_allowed_access( bool file_existed, uint32_t *p_access_mask) { - uint32_t access_mask = *p_access_mask; NTSTATUS status; if (get_current_uid(conn) == (uid_t)0) { - access_mask |= FILE_GENERIC_ALL; + *p_access_mask |= FILE_GENERIC_ALL; } else if (file_existed) { struct security_descriptor *sd; uint32_t access_granted = 0; @@ -1510,7 +1509,7 @@ static NTSTATUS smbd_calculate_maximum_allowed_access( */ status = se_access_check(sd, get_current_nttok(conn), - (access_mask & ~FILE_READ_ATTRIBUTES), + (*p_access_mask & ~FILE_READ_ATTRIBUTES), &access_granted); TALLOC_FREE(sd); @@ -1523,11 +1522,10 @@ static NTSTATUS smbd_calculate_maximum_allowed_access( return NT_STATUS_ACCESS_DENIED; } - access_mask = (access_granted | FILE_READ_ATTRIBUTES); + *p_access_mask = (access_granted | FILE_READ_ATTRIBUTES); } else { - access_mask = FILE_GENERIC_ALL; + *p_access_mask = FILE_GENERIC_ALL; } - *p_access_mask = access_mask; return NT_STATUS_OK; } |