From 8cadd19a91cc4cded493b9ba5dec821f93dcfb54 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 16 Dec 2011 18:45:14 +0100 Subject: s3: Directly use *p_access_mask in smbd_calculate_maximum_allowed_access --- source3/smbd/open.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/smbd') 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; } -- cgit