Fix the overwriting of errno before use in a DEBUG statement and use the return value...
authorRichard Sharpe <realrichardsharpe@gmail.com>
Tue, 15 May 2012 14:47:14 +0000 (07:47 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 19 May 2012 18:39:44 +0000 (20:39 +0200)
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Wed May 16 03:43:41 CEST 2012 on sn-devel-104
(cherry picked from commit bfe4a2baeec6bc4558a617ec67532ea11f865861)

source3/modules/vfs_acl_common.c
source3/modules/vfs_acl_xattr.c

index 097fd20dc04d7fa5655dc4cf0dfcc0ae11134c62..bc9f56b798f33f394d8b8b2d27a68426e540b830 100644 (file)
@@ -804,10 +804,13 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp,
                NDR_PRINT_DEBUG(security_descriptor,
                        CONST_DISCARD(struct security_descriptor *,psd));
        }
+       /*
+        * Perhaps create_acl_blob should have a status return as well
+        */
        create_acl_blob(psd, &blob, XATTR_SD_HASH_TYPE_SHA256, hash);
-       store_acl_blob_fsp(handle, fsp, &blob);
+       status = store_acl_blob_fsp(handle, fsp, &blob);
 
-       return NT_STATUS_OK;
+       return status;
 }
 
 static SMB_STRUCT_DIR *opendir_acl_common(vfs_handle_struct *handle,
index ca23fad179160978acb7bfb65d52cfc2d7d2ab95..12ed82939a3959248b02b3f2a1a0ed7bc5bd8e9f 100644 (file)
@@ -119,12 +119,12 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
        }
        unbecome_root();
        if (ret) {
-               errno = saved_errno;
                DEBUG(5, ("store_acl_blob_fsp: setting attr failed for file %s"
                        "with error %s\n",
                        fsp_str_dbg(fsp),
-                       strerror(errno) ));
-               return map_nt_error_from_unix(errno);
+                       strerror(saved_errno) ));
+               errno = saved_errno;
+               return map_nt_error_from_unix(saved_errno);
        }
        return NT_STATUS_OK;
 }