]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Clarify logic with helper variables in smb_set_posix_acl()
authorJeremy Allison <jra@samba.org>
Thu, 13 Jun 2019 23:07:59 +0000 (16:07 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 24 Jun 2019 18:49:09 +0000 (18:49 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/trans2.c

index b860bff50d9b9a2c255e91f026b3b7df7f659643..62ace74246fb8393e81e754866d9796a24affbae 100644 (file)
@@ -7286,21 +7286,30 @@ static NTSTATUS smb_set_posix_acl(connection_struct *conn,
        /* Move pdata to the start of the file ACL entries. */
        pdata += SMB_POSIX_ACL_HEADER_SIZE;
 
-       if (valid_file_acls && !set_unix_posix_acl(conn, fsp,
-               smb_fname, num_file_acls,
-               pdata)) {
-               status = map_nt_error_from_unix(errno);
-               goto out;
+       if (valid_file_acls) {
+               bool ok = set_unix_posix_acl(conn,
+                                       fsp,
+                                       smb_fname,
+                                       num_file_acls,
+                                       pdata);
+               if (!ok) {
+                       status = map_nt_error_from_unix(errno);
+                       goto out;
+               }
        }
 
        /* Move pdata to the start of the default ACL entries. */
        pdata += (num_file_acls*SMB_POSIX_ACL_ENTRY_SIZE);
 
-       if (valid_def_acls && !set_unix_posix_default_acl(conn,
-               smb_fname, num_def_acls,
-               pdata)) {
-               status = map_nt_error_from_unix(errno);
-               goto out;
+       if (valid_def_acls) {
+               bool ok = set_unix_posix_default_acl(conn,
+                                       smb_fname,
+                                       num_def_acls,
+                                       pdata);
+               if (!ok) {
+                       status = map_nt_error_from_unix(errno);
+                       goto out;
+               }
        }
 
        status = NT_STATUS_OK;