summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-05-10 12:29:35 +0200
committerKarolin Seeger <kseeger@samba.org>2018-05-24 11:29:23 +0200
commitbcee54726fadd76ee1588c15b29066f66ad9c1c0 (patch)
tree0d0861dd216acf70453b736206cd543b37e761d7
parent6ea5d164cd9d836cbd36aa43fa2b7f4b270a68f3 (diff)
downloadsamba-bcee54726fadd76ee1588c15b29066f66ad9c1c0.tar.gz
s3:smbd: fix interaction between chown and SD flags
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 (cherry picked from commit ced55850034a3653525823bf9623912a4fcf18a0)
-rw-r--r--selftest/knownfail.d/samba3.smb2.acls1
-rw-r--r--source3/modules/vfs_acl_common.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/selftest/knownfail.d/samba3.smb2.acls b/selftest/knownfail.d/samba3.smb2.acls
deleted file mode 100644
index 68966c951a9..00000000000
--- a/selftest/knownfail.d/samba3.smb2.acls
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.acls.SDFLAGSVSCHOWN.*
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 546e97b9b5d..f2b2df19400 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -941,8 +941,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)) {