]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Reformat code in SEC_FLAG_SYSTEM_SECURITY check in create_file_unixpath().
authorJeremy Allison <jra@samba.org>
Fri, 17 Apr 2020 21:20:13 +0000 (14:20 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 21 Apr 2020 18:37:40 +0000 (18:37 +0000)
No logic change but uses modern formatting and will
make it easier to add another clause in the next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index 9beabb6a109a1b136379818fa3c56049c4232464..d4c77602daf0151c0beac1a37654a358ec693cd0 100644 (file)
@@ -5420,14 +5420,18 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
                }
        }
 
-       if ((access_mask & SEC_FLAG_SYSTEM_SECURITY) &&
-                       !security_token_has_privilege(get_current_nttok(conn),
-                                       SEC_PRIV_SECURITY)) {
-               DEBUG(10, ("create_file_unixpath: open on %s "
-                       "failed - SEC_FLAG_SYSTEM_SECURITY denied.\n",
-                       smb_fname_str_dbg(smb_fname)));
-               status = NT_STATUS_PRIVILEGE_NOT_HELD;
-               goto fail;
+       if (access_mask & SEC_FLAG_SYSTEM_SECURITY) {
+               bool ok;
+
+               ok = security_token_has_privilege(get_current_nttok(conn),
+                                                 SEC_PRIV_SECURITY);
+               if (!ok) {
+                       DBG_DEBUG("open on %s failed - "
+                               "SEC_FLAG_SYSTEM_SECURITY denied.\n",
+                               smb_fname_str_dbg(smb_fname));
+                       status = NT_STATUS_PRIVILEGE_NOT_HELD;
+                       goto fail;
+               }
        }
 
        /*