1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

smbd: use openat_pathref_fsp() in get_file_handle_for_metadata()

Ensures we have a pathref handle in the smb_fname we pass to
SMB_VFS_CREATE_FILE().

As the create_disposition is FILE_OPEN we just return the error if
openat_pathref_fsp() fails

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-11-12 12:51:04 +01:00
parent a74f0af1a9
commit e5adfe64fc

View File

@ -1392,6 +1392,15 @@ static NTSTATUS get_file_handle_for_metadata(connection_struct *conn,
return NT_STATUS_NO_MEMORY;
}
status = openat_pathref_fsp(conn->cwd_fsp, smb_fname_cp);
if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(smb_fname_cp);
return status;
}
/* Opens an INTERNAL_OPEN_ONLY write handle. */
status = SMB_VFS_CREATE_FILE(
conn, /* conn */