From 1dfd8df23d63f786788bc24ebb71039feaf34d91 Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Tue, 2 Aug 2016 09:37:00 +0300 Subject: smbd: add an option to inherit only the UNIX owner This can be used to emulate folder quotas, as explained in the modified manpage. Signed-off-by: Uri Simchoni Reviewed-by: Jeremy Allison --- source3/smbd/posix_acls.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/smbd/posix_acls.c') diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index c5755683658..e8e819c7eeb 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3754,6 +3754,14 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_info_sent &= ~SECINFO_GROUP; } + /* If UNIX owner is inherited and Windows isn't, then + * setting the UNIX owner based on Windows owner conflicts + * with the inheritance rule + */ + if (lp_inherit_owner(SNUM(conn)) == INHERIT_OWNER_UNIX_ONLY) { + security_info_sent &= ~SECINFO_OWNER; + } + status = unpack_nt_owners( conn, &user, &grp, security_info_sent, psd); if (!NT_STATUS_IS_OK(status)) { return status; -- cgit v1.2.1