summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-04-18 22:53:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:39 -0500
commit7f247f7b4de67b3e0a857b146a186e5eabc79235 (patch)
tree4ad4a675fa883e5eceab8181f017726b6d3a8581 /source3
parentfaf0b035222777941dd27d9612e0d387333a7650 (diff)
downloadsamba-7f247f7b4de67b3e0a857b146a186e5eabc79235.tar.gz
samba-7f247f7b4de67b3e0a857b146a186e5eabc79235.tar.bz2
samba-7f247f7b4de67b3e0a857b146a186e5eabc79235.zip
r6378: Other systems may not return 1 for checking WRITE permission.
Canaonicalise any +ve return to 1. Jeremy. (This used to be commit e594222d0ba7713088420f6c6603a74c1d5def8e)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/posix_acls.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 353f9a3b03..04429d0456 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3742,6 +3742,7 @@ BOOL set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *
/****************************************************************************
Check for POSIX group ACLs. If none use stat entry.
+ Return -1 if no match, 0 if match and denied, 1 if match and allowed.
****************************************************************************/
static int check_posix_acl_group_write(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
@@ -3782,6 +3783,12 @@ static int check_posix_acl_group_write(connection_struct *conn, const char *fnam
goto check_stat;
}
+ /*
+ * Solaris returns 2 for this if write is available.
+ * canonicalize to 0 or 1.
+ */
+ have_write = (have_write ? 1 : 0);
+
switch(tagtype) {
case SMB_ACL_MASK:
if (!have_write) {
@@ -3845,6 +3852,12 @@ match on user %u -> %s.\n", fname, (unsigned int)*puid, ret ? "can write" : "can
goto check_stat;
}
+ /*
+ * Solaris returns 2 for this if write is available.
+ * canonicalize to 0 or 1.
+ */
+ have_write = (have_write ? 1 : 0);
+
switch(tagtype) {
case SMB_ACL_GROUP:
{