summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c12
-rw-r--r--source3/smbd/proto.h4
2 files changed, 10 insertions, 6 deletions
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,