s3:smbd: fix interaction between chown and SD flags
authorRalph Boehme <slow@samba.org>
Thu, 10 May 2018 10:29:35 +0000 (12:29 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 11 May 2018 21:30:31 +0000 (23:30 +0200)
A change ownership operation that doesn't set the NT ACLs must not touch
the SD flags (type).

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13432

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 11 23:30:32 CEST 2018 on sn-devel-144

selftest/knownfail.d/samba3.smb2.acls [deleted file]
source3/modules/vfs_acl_common.c

diff --git a/selftest/knownfail.d/samba3.smb2.acls b/selftest/knownfail.d/samba3.smb2.acls
deleted file mode 100644 (file)
index 68966c9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.acls.SDFLAGSVSCHOWN.*
index b323079d08aa59412779c314e136d41b9780a0b0..5b2b2ef60e387db087bb7822360b981ddb30d613 100644 (file)
@@ -942,8 +942,11 @@ NTSTATUS fset_nt_acl_common(
        }
 
        psd->revision = orig_psd->revision;
-       /* All our SD's are self relative. */
-       psd->type = orig_psd->type | SEC_DESC_SELF_RELATIVE;
+       if (security_info_sent & SECINFO_DACL) {
+               psd->type = orig_psd->type;
+               /* All our SD's are self relative. */
+               psd->type |= SEC_DESC_SELF_RELATIVE;
+       }
 
        if ((security_info_sent & SECINFO_OWNER) && (orig_psd->owner_sid != NULL)) {
                if (!dom_sid_equal(orig_psd->owner_sid, psd->owner_sid)) {