summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-10-28 01:38:59 +0200
committerMichael Adam <obnox@samba.org>2007-12-19 23:07:55 +0100
commit13e0788714c1a5a3ce62597d04d3034ca14d031e (patch)
tree4038a05899283838e10427e83b44b06d01cdd917 /source3/smbd
parentc5d21d1a651aa02c7b3e2fbaa89b8364bdfbfa68 (diff)
downloadsamba-13e0788714c1a5a3ce62597d04d3034ca14d031e.tar.gz
samba-13e0788714c1a5a3ce62597d04d3034ca14d031e.tar.bz2
samba-13e0788714c1a5a3ce62597d04d3034ca14d031e.zip
Change canonicalise_acl() to not take an fsp.
Convert canonicalise_acl() to take connection_struct, is_directory and file name instead of files_struct pointer. Michael (This used to be commit d579a7f84fd47a3f00215725cecd65b21a5ff2e0)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/posix_acls.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 7be4ee1c80..1b91823ea2 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -2110,10 +2110,11 @@ 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 files_struct *fsp, SMB_ACL_T posix_acl, SMB_STRUCT_STAT *psbuf,
+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)
{
- connection_struct *conn = fsp->conn;
mode_t acl_mask = (S_IRUSR|S_IWUSR|S_IXUSR);
canon_ace *list_head = NULL;
canon_ace *ace = NULL;
@@ -2228,7 +2229,7 @@ static canon_ace *canonicalise_acl( const files_struct *fsp, SMB_ACL_T posix_acl
* This next call will ensure we have at least a user/group/world set.
*/
- if (!ensure_canon_entry_valid(&list_head, fsp->conn->params, fsp->is_directory, powner, pgroup, psbuf, False))
+ if (!ensure_canon_entry_valid(&list_head, conn->params, is_directory, powner, pgroup, psbuf, False))
goto fail;
/*
@@ -2254,7 +2255,7 @@ static canon_ace *canonicalise_acl( const files_struct *fsp, SMB_ACL_T posix_acl
}
}
- arrange_posix_perms(fsp->fsp_name,&list_head );
+ arrange_posix_perms(fname,&list_head );
print_canon_ace_list( "canonicalise_acl: ace entries after arrange", list_head );
@@ -2816,7 +2817,10 @@ NTSTATUS get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
*/
/* Create the canon_ace lists. */
- file_ace = canonicalise_acl( fsp, posix_acl, &sbuf, &owner_sid, &group_sid, pal, SMB_ACL_TYPE_ACCESS );
+ file_ace = canonicalise_acl(fsp->conn, fsp->is_directory,
+ fsp->fsp_name, posix_acl, &sbuf,
+ &owner_sid, &group_sid, pal,
+ SMB_ACL_TYPE_ACCESS);
/* We must have *some* ACLS. */
@@ -2826,9 +2830,12 @@ NTSTATUS get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
}
if (fsp->is_directory && def_acl) {
- dir_ace = canonicalise_acl(fsp, def_acl, &sbuf,
- &global_sid_Creator_Owner,
- &global_sid_Creator_Group, pal, SMB_ACL_TYPE_DEFAULT );
+ dir_ace = canonicalise_acl(fsp->conn, fsp->is_directory,
+ fsp->fsp_name, def_acl,
+ &sbuf,
+ &global_sid_Creator_Owner,
+ &global_sid_Creator_Group,
+ pal, SMB_ACL_TYPE_DEFAULT);
}
/*