From 7f247f7b4de67b3e0a857b146a186e5eabc79235 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 Apr 2005 22:53:51 +0000 Subject: r6378: Other systems may not return 1 for checking WRITE permission. Canaonicalise any +ve return to 1. Jeremy. (This used to be commit e594222d0ba7713088420f6c6603a74c1d5def8e) --- source3/smbd/posix_acls.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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: { -- cgit