diff options
author | Jeremy Allison <jra@samba.org> | 2012-03-13 12:16:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-03-13 21:56:15 +0100 |
commit | 0e376db8b8b3770b189fbd9b3874406bcafcfd32 (patch) | |
tree | 2fe53c28629213ac86d86e68acf70b2ed94f383c /source3/smbd/posix_acls.c | |
parent | 7936fb0ab8c3413768e83975c9d8544d653ee13c (diff) | |
download | samba-0e376db8b8b3770b189fbd9b3874406bcafcfd32.tar.gz |
Second part of fix for bug #7933 - samba fails to honor SEC_STD_WRITE_OWNER bit with the acl_xattr module.
Error found by Andrew Bartlett <abartlet@samba.org> and Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.
Don't use a pointer when you really mean a bool flag.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Mar 13 21:56:15 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/smbd/posix_acls.c')
-rw-r--r-- | source3/smbd/posix_acls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 029eeaeeccb..f54bfa1648a 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -1502,20 +1502,22 @@ static bool ensure_canon_entry_valid(connection_struct *conn, canon_ace **pp_ace then if the ownership or group ownership of this file or directory gets changed, the user or group can lose their access. */ + bool got_duplicate_user = false; + bool got_duplicate_group = false; for (pace = *pp_ace; pace; pace = pace->next) { if (pace->type == SMB_ACL_USER && pace->unix_ug.uid == pace_user->unix_ug.uid) { /* Already got one. */ - pace_user = NULL; + got_duplicate_user = true; } else if (pace->type == SMB_ACL_USER && pace->unix_ug.uid == pace_user->unix_ug.uid) { /* Already got one. */ - pace_group = NULL; + got_duplicate_group = true; } } - if (pace_user) { + if (!got_duplicate_user) { /* Add a duplicate SMB_ACL_USER entry. */ if ((pace = talloc(talloc_tos(), canon_ace)) == NULL) { DEBUG(0,("ensure_canon_entry_valid: talloc fail.\n")); @@ -1533,7 +1535,7 @@ static bool ensure_canon_entry_valid(connection_struct *conn, canon_ace **pp_ace DLIST_ADD(*pp_ace, pace); } - if (pace_group) { + if (!got_duplicate_group) { /* Add a duplicate SMB_ACL_GROUP entry. */ if ((pace = talloc(talloc_tos(), canon_ace)) == NULL) { DEBUG(0,("ensure_canon_entry_valid: talloc fail.\n")); |