mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
smbd: use fd_openat()
This leaves basically two callers of fd_open(): * open_internal_dirfsp_at() * smbd_smb2_query_directory_send() Those will be the only codepaths that use full paths relative to the share root and so require and use the symlink race protection provided by non_widelink_open(). Of course, until we actuall start passing real dirfsps to fd_openat(), fd_openat() internally calls fd_open(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
eaf1c6a338
commit
75d6943ed8
@ -815,7 +815,7 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
|
||||
flags = O_RDONLY;
|
||||
}
|
||||
|
||||
status = fd_open(fsp, flags, 0 /* mode */);
|
||||
status = fd_openat(fsp, flags, 0);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
TALLOC_FREE(lck);
|
||||
DEBUG(1, ("vfs_default_durable_reconnect: failed to open "
|
||||
|
@ -1116,7 +1116,7 @@ static NTSTATUS fd_open_atomic(files_struct *fsp,
|
||||
/*
|
||||
* We're not creating the file, just pass through.
|
||||
*/
|
||||
status = fd_open(fsp, flags, mode);
|
||||
status = fd_openat(fsp, flags, mode);
|
||||
*file_created = false;
|
||||
return status;
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ static NTSTATUS fd_open_atomic(files_struct *fsp,
|
||||
/*
|
||||
* Fail if already exists, just pass through.
|
||||
*/
|
||||
status = fd_open(fsp, flags, mode);
|
||||
status = fd_openat(fsp, flags, mode);
|
||||
|
||||
/*
|
||||
* Here we've opened with O_CREAT|O_EXCL. If that went
|
||||
@ -1165,7 +1165,7 @@ static NTSTATUS fd_open_atomic(files_struct *fsp,
|
||||
retry_status = NT_STATUS_OBJECT_NAME_COLLISION;
|
||||
}
|
||||
|
||||
status = fd_open(fsp, curr_flags, mode);
|
||||
status = fd_openat(fsp, curr_flags, mode);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
*file_created = !file_existed;
|
||||
return NT_STATUS_OK;
|
||||
@ -1184,7 +1184,7 @@ static NTSTATUS fd_open_atomic(files_struct *fsp,
|
||||
curr_flags = flags | O_EXCL;
|
||||
}
|
||||
|
||||
status = fd_open(fsp, curr_flags, mode);
|
||||
status = fd_openat(fsp, curr_flags, mode);
|
||||
}
|
||||
|
||||
*file_created = (NT_STATUS_IS_OK(status) && !file_existed);
|
||||
@ -4584,7 +4584,7 @@ static NTSTATUS open_directory(connection_struct *conn,
|
||||
flags |= O_DIRECTORY;
|
||||
#endif
|
||||
|
||||
status = fd_open(fsp, flags, 0);
|
||||
status = fd_openat(fsp, flags, 0);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DBG_INFO("Could not open fd for "
|
||||
"%s (%s)\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user