From: Ralph Boehme Date: Thu, 10 May 2018 10:29:35 +0000 (+0200) Subject: s3:smbd: fix interaction between chown and SD flags X-Git-Tag: ldb-1.4.0~341 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ced55850034a3653525823bf9623912a4fcf18a0;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri May 11 23:30:32 CEST 2018 on sn-devel-144 --- 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 b323079d08a..5b2b2ef60e3 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -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)) {