mirror of
https://github.com/samba-team/samba.git
synced 2025-08-08 13:49:29 +03:00
smbd: remove dirfsp arg from mkdir_internal()
Prepares for removing the dirfsp arg from SMB_VFS_CREATE_FILE() again. In the future mkdir_internal() will open the dirfsp itself as needed. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
d196cf4604
commit
7ccaff4857
@ -4165,7 +4165,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
|
||||
}
|
||||
|
||||
static NTSTATUS mkdir_internal(connection_struct *conn,
|
||||
struct files_struct **dirfsp,
|
||||
struct smb_filename *smb_dname,
|
||||
uint32_t file_attributes)
|
||||
{
|
||||
@ -4180,8 +4179,6 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
|
||||
int ret;
|
||||
bool ok;
|
||||
|
||||
SMB_ASSERT(*dirfsp == conn->cwd_fsp);
|
||||
|
||||
if (!CAN_WRITE(conn) || (access_mask & ~(conn->share_access))) {
|
||||
DEBUG(5,("mkdir_internal: failing share access "
|
||||
"%s\n", lp_servicename(talloc_tos(), lp_sub, SNUM(conn))));
|
||||
@ -4207,7 +4204,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
|
||||
}
|
||||
|
||||
status = check_parent_access(conn,
|
||||
*dirfsp,
|
||||
conn->cwd_fsp,
|
||||
smb_dname,
|
||||
access_mask);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
@ -4220,7 +4217,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
|
||||
}
|
||||
|
||||
ret = SMB_VFS_MKDIRAT(conn,
|
||||
*dirfsp,
|
||||
conn->cwd_fsp,
|
||||
smb_dname,
|
||||
mode);
|
||||
if (ret != 0) {
|
||||
@ -4399,7 +4396,8 @@ static NTSTATUS open_directory(connection_struct *conn,
|
||||
return status;
|
||||
}
|
||||
|
||||
status = mkdir_internal(conn, dirfsp, smb_dname,
|
||||
status = mkdir_internal(conn,
|
||||
smb_dname,
|
||||
file_attributes);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
@ -4423,8 +4421,9 @@ static NTSTATUS open_directory(connection_struct *conn,
|
||||
status = NT_STATUS_OK;
|
||||
info = FILE_WAS_OPENED;
|
||||
} else {
|
||||
status = mkdir_internal(conn, dirfsp, smb_dname,
|
||||
file_attributes);
|
||||
status = mkdir_internal(conn,
|
||||
smb_dname,
|
||||
file_attributes);
|
||||
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
info = FILE_WAS_CREATED;
|
||||
|
Reference in New Issue
Block a user