From a11c0a41a35aa2b1c14333552045a65e3e50df1e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 31 Oct 2011 12:37:39 -0700 Subject: 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. --- source3/smbd/open.c | 12 ++++++------ source3/smbd/proto.h | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 42edddcaf9..e8c24a0a68 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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)) { diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 343b0b916e..351fc4992b 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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, -- cgit