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)
committerRichard Sharpe <sharpe@samba.org>
Wed, 16 May 2012 01:43:40 +0000 (03:43 +0200)
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Wed May 16 03:43:41 CEST 2012 on sn-devel-104

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

index 241bc8f7e6996dcd2efad564362e1de6c68afc52..221b43f7481e0bdcec7f334968249eb6a4c64e79 100644 (file)
@@ -592,10 +592,13 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp,
                NDR_PRINT_DEBUG(security_descriptor,
                        discard_const_p(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 int acl_common_remove_object(vfs_handle_struct *handle,
index 5653657066d4ac8957143e0729e5d72460046b14..c1b0a60e16a7c5457b7e6e731a1a2bfffb30bd5a 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;
 }