#ifdef O_DIRECTORY
open_flags |= O_DIRECTORY;
#endif
- status = fd_open(fsp, open_flags, 0);
+ status = fd_openat(conn->cwd_fsp, fsp->fsp_name, fsp, open_flags, 0);
if (!NT_STATUS_IS_OK(status)) {
DBG_INFO("Could not open fd for %s (%s)\n",
smb_fname_str_dbg(smb_dname),
fd support routines - attempt to do a dos_open.
****************************************************************************/
-NTSTATUS fd_open(files_struct *fsp,
- int flags,
- mode_t mode)
+NTSTATUS fd_openat(const struct files_struct *dirfsp,
+ struct smb_filename *smb_fname,
+ files_struct *fsp,
+ int flags,
+ mode_t mode)
{
struct connection_struct *conn = fsp->conn;
- struct smb_filename *smb_fname = fsp->fsp_name;
NTSTATUS status = NT_STATUS_OK;
int fd;
/*
* We're not creating the file, just pass through.
*/
- status = fd_open(fsp, flags, mode);
+ status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, flags, mode);
*file_created = false;
return status;
}
/*
* Fail if already exists, just pass through.
*/
- status = fd_open(fsp, flags, mode);
+ status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, flags, mode);
/*
* Here we've opened with O_CREAT|O_EXCL. If that went
retry_status = NT_STATUS_OBJECT_NAME_COLLISION;
}
- status = fd_open(fsp, curr_flags, mode);
+ status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, curr_flags, mode);
if (NT_STATUS_IS_OK(status)) {
*file_created = !file_existed;
return NT_STATUS_OK;
curr_flags = flags | O_EXCL;
}
- status = fd_open(fsp, curr_flags, mode);
+ status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, curr_flags, mode);
}
*file_created = (NT_STATUS_IS_OK(status) && !file_existed);
flags |= O_DIRECTORY;
#endif
- status = fd_open(fsp, flags, 0);
+ status = fd_openat(conn->cwd_fsp, fsp->fsp_name, fsp, flags, 0);
if (!NT_STATUS_IS_OK(status)) {
DBG_INFO("Could not open fd for "
"%s (%s)\n",
struct files_struct *dirfsp,
struct smb_filename *smb_fname,
uint32_t access_mask);
-NTSTATUS fd_open(files_struct *fsp,
- int flags, mode_t mode);
+NTSTATUS fd_openat(const struct files_struct *dirfsp,
+ struct smb_filename *smb_fname,
+ files_struct *fsp,
+ int flags, mode_t mode);
NTSTATUS fd_close(files_struct *fsp);
void change_file_owner_to_parent(connection_struct *conn,
struct smb_filename *inherit_from_dir,