1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Change function signature of check_parent_access() to take char * instead of struct smb_filename.

Expose it so it can be called from directory code.
This commit is contained in:
Jeremy Allison 2011-10-31 12:37:39 -07:00
parent f5fde21ec1
commit a11c0a41a3
2 changed files with 10 additions and 6 deletions

View File

@ -201,8 +201,8 @@ static NTSTATUS smbd_check_open_rights(struct connection_struct *conn,
}
}
static NTSTATUS check_parent_access(struct connection_struct *conn,
struct smb_filename *smb_fname,
NTSTATUS check_parent_access(struct connection_struct *conn,
const char *path,
uint32_t access_mask,
char **pp_parent_dir)
{
@ -212,7 +212,7 @@ static NTSTATUS check_parent_access(struct connection_struct *conn,
uint32_t access_granted = 0;
if (!parent_dirname(talloc_tos(),
smb_fname->base_name,
path,
&parent_dir,
NULL)) {
return NT_STATUS_NO_MEMORY;
@ -241,7 +241,7 @@ static NTSTATUS check_parent_access(struct connection_struct *conn,
"on directory %s for "
"path %s for mask 0x%x returned (0x%x) %s\n",
parent_dir,
smb_fname->base_name,
path,
access_mask,
access_granted,
nt_errstr(status) ));
@ -618,7 +618,7 @@ static NTSTATUS open_file(files_struct *fsp,
access_mask);
} else if (local_flags & O_CREAT){
status = check_parent_access(conn,
smb_fname,
smb_fname->base_name,
SEC_DIR_ADD_FILE,
NULL);
} else {
@ -2564,7 +2564,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
}
status = check_parent_access(conn,
smb_dname,
smb_dname->base_name,
access_mask,
&parent_dir);
if(!NT_STATUS_IS_OK(status)) {

View File

@ -585,6 +585,10 @@ NTSTATUS smb1_file_se_access_check(connection_struct *conn,
const struct security_token *token,
uint32_t access_desired,
uint32_t *access_granted);
NTSTATUS check_parent_access(struct connection_struct *conn,
const char *path,
uint32_t access_mask,
char **pp_parent_dir);
NTSTATUS fd_close(files_struct *fsp);
void change_file_owner_to_parent(connection_struct *conn,
const char *inherit_from_dir,