summaryrefslogtreecommitdiffstats
path: root/source/smbd/posix_acls.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-11-06 06:20:51 +0100
committerMichael Adam <obnox@samba.org>2007-12-19 23:07:56 +0100
commitb0ae830bf57dcaec00b2a2eabfec7221a3b7f791 (patch)
treeed02faadb8a77476155f4b85344444f0dd65b074 /source/smbd/posix_acls.c
parentd579a7f84fd47a3f00215725cecd65b21a5ff2e0 (diff)
downloadsamba-b0ae830bf57dcaec00b2a2eabfec7221a3b7f791.tar.gz
samba-b0ae830bf57dcaec00b2a2eabfec7221a3b7f791.tar.xz
samba-b0ae830bf57dcaec00b2a2eabfec7221a3b7f791.zip
Remove the "is_directory" parameter from canonicalise_acl():
It can be retrieved from the stat buffer. Michael
Diffstat (limited to 'source/smbd/posix_acls.c')
-rw-r--r--source/smbd/posix_acls.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index 1b91823ea2e..57a3ff9766a 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -2110,10 +2110,10 @@ static void arrange_posix_perms(const char *filename, canon_ace **pp_list_head)
Create a linked list of canonical ACE entries.
****************************************************************************/
-static canon_ace *canonicalise_acl(const struct connection_struct *conn,
- const bool is_directory, const char *fname,
- SMB_ACL_T posix_acl, SMB_STRUCT_STAT *psbuf,
- const DOM_SID *powner, const DOM_SID *pgroup, struct pai_val *pal, SMB_ACL_TYPE_T the_acl_type)
+static canon_ace *canonicalise_acl(struct connection_struct *conn,
+ const char *fname, SMB_ACL_T posix_acl,
+ const SMB_STRUCT_STAT *psbuf,
+ const DOM_SID *powner, const DOM_SID *pgroup, struct pai_val *pal, SMB_ACL_TYPE_T the_acl_type)
{
mode_t acl_mask = (S_IRUSR|S_IWUSR|S_IXUSR);
canon_ace *list_head = NULL;
@@ -2229,7 +2229,9 @@ static canon_ace *canonicalise_acl(const struct connection_struct *conn,
* This next call will ensure we have at least a user/group/world set.
*/
- if (!ensure_canon_entry_valid(&list_head, conn->params, is_directory, powner, pgroup, psbuf, False))
+ if (!ensure_canon_entry_valid(&list_head, conn->params,
+ S_ISDIR(psbuf->st_mode), powner, pgroup,
+ psbuf, False))
goto fail;
/*
@@ -2817,7 +2819,7 @@ NTSTATUS get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
*/
/* Create the canon_ace lists. */
- file_ace = canonicalise_acl(fsp->conn, fsp->is_directory,
+ file_ace = canonicalise_acl(fsp->conn,
fsp->fsp_name, posix_acl, &sbuf,
&owner_sid, &group_sid, pal,
SMB_ACL_TYPE_ACCESS);
@@ -2830,7 +2832,7 @@ NTSTATUS get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
}
if (fsp->is_directory && def_acl) {
- dir_ace = canonicalise_acl(fsp->conn, fsp->is_directory,
+ dir_ace = canonicalise_acl(fsp->conn,
fsp->fsp_name, def_acl,
&sbuf,
&global_sid_Creator_Owner,