summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-17 15:54:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:19 -0500
commita5808e7ddbe3d333057c44db5e76bf8ef032489a (patch)
tree3d64cb159c40a9bdb270658088d5fa0ee74eb96f /source3/smbd
parentfee4b03e02af795a55ba0b955b9e6b07856d05dd (diff)
downloadsamba-a5808e7ddbe3d333057c44db5e76bf8ef032489a.tar.gz
samba-a5808e7ddbe3d333057c44db5e76bf8ef032489a.tar.bz2
samba-a5808e7ddbe3d333057c44db5e76bf8ef032489a.zip
r7693: Fix from James Peach @ SGI for null pointer ACL free.
Jeremy. (This used to be commit 000477943c3dd41fd44f2aef3755aa603ba5d595)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/posix_acls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 796587c94c..a3174440ef 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -2949,7 +2949,9 @@ static int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_
return 0;
/* Case (2). */
- if ((uid == current_user.uid) && (user_has_privileges(current_user.nt_user_token,&se_take_ownership))) {
+ if (lp_enable_privileges() &&
+ (uid == current_user.uid) &&
+ (user_has_privileges(current_user.nt_user_token,&se_take_ownership))) {
become_root();
/* Keep the current file gid the same - take ownership doesn't imply group change. */
ret = SMB_VFS_CHOWN(conn, fname, uid, (gid_t)-1);
@@ -3970,7 +3972,9 @@ failed to match on user or group in token (ret = %d).\n", fname, ret ));
done:
- SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
+ if (posix_acl) {
+ SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
+ }
DEBUG(10,("check_posix_acl_group_write: file %s returning (ret = %d).\n", fname, ret ));
return ret;