Check the return from create_acl_blob
authorRichard Sharpe <realrichardsharpe@gmail.com>
Thu, 17 May 2012 03:21:34 +0000 (20:21 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 19 May 2012 18:40:18 +0000 (20:40 +0200)
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Thu May 17 07:17:29 CEST 2012 on sn-devel-104
(cherry picked from commit 632af6645376185500820a5be9dbf5c0c3d1e515)

The last two commits address bug #8945 (vfs_acl_common discards errors from
writing to the underlying storage).

source3/modules/vfs_acl_common.c

index bc9f56b798f33f394d8b8b2d27a68426e540b830..56da3aff5677c6fa232830e31146256379e8d253 100644 (file)
@@ -804,10 +804,12 @@ 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);
+       status = create_acl_blob(psd, &blob, XATTR_SD_HASH_TYPE_SHA256, hash);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(10, ("fset_nt_acl_xattr: create_acl_blob failed\n"));
+               return status;
+       }
+
        status = store_acl_blob_fsp(handle, fsp, &blob);
 
        return status;