Commit
86f7af84 introduced a problem that a chown is always attempted,
even when the owning gid did not change. Then the ACL is set in the file
system as root. Fix the check by correctly comparing with gid, not uid.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15120
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Wed Jul 13 17:30:30 UTC 2022 on sn-devel-184
/* chown logic is a copy/paste from posix_acl.c:set_nt_acl */
uid_t old_uid = fsp->fsp_name->st.st_ex_uid;
- uid_t old_gid = fsp->fsp_name->st.st_ex_uid;
+ gid_t old_gid = fsp->fsp_name->st.st_ex_gid;
status = unpack_nt_owners(fsp->conn, &newUID, &newGID,
security_info_sent, psd);
if (!NT_STATUS_IS_OK(status)) {