This was supposed to be a shortcut to avoid passing dirfsp around as an explicit
function argument throughout the whole codebase when the new VFS design idea was
based on using *AT functions throughout the VFS.
Now that we've opted for basing the VFS on handles and *AT functions will only
be used in a much more limitted extent, it makes sense to remove this internal
dirfsp reference, otherwise the combination of internal fsp->dirfsp and
smb_fname->fsp is going to be a tough to wrap your head around.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
* Version 43 - SMB_VFS_READ_DFS_PATHAT() should take a non-const name.
There's no easy way to return stat info for a DFS link
otherwise.
+ * Change to Version 44 - will ship with 4.14.
+ * Version 44 - Remove dirfsp arg from struct files_struct
*/
-#define SMB_VFS_INTERFACE_VERSION 43
+#define SMB_VFS_INTERFACE_VERSION 44
/*
All intercepted VFS operations must be declared as static functions inside module source
struct smbXsrv_open *op;
struct connection_struct *conn;
struct fd_handle *fh;
- struct files_struct *dirfsp;
unsigned int num_smb_operations;
struct file_id file_id;
uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */
return "";
}
- if (fsp->dirfsp == NULL || fsp->dirfsp == fsp->conn->cwd_fsp) {
- return name;
- }
-
- if (ISDOT(fsp->dirfsp->fsp_name->base_name)) {
- return name;
- }
-
- name = smb_fname_str_dbg(fsp->fsp_name);
- if (name == NULL) {
- return "";
- }
-
- name = talloc_asprintf(talloc_tos(),
- "%s/%s",
- fsp->dirfsp->fsp_name->base_name,
- name);
- if (name == NULL) {
- return "";
- }
return name;
}
return NT_STATUS_OK;
}
- if (fsp->dirfsp != NULL &&
- fsp->dirfsp != fsp->conn->cwd_fsp)
- {
- status = fd_close(fsp->dirfsp);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- file_free(NULL, fsp->dirfsp);
- fsp->dirfsp = NULL;
- }
-
if (fsp->fsp_flags.is_directory) {
status = close_directory(req, fsp, close_type);
} else if (fsp->fake_file_handle != NULL) {
fsp->close_write_time = nt_time_to_full_timespec(
cookie.close_write_time);
- /* TODO: real dirfsp... */
- fsp->dirfsp = fsp->conn->cwd_fsp;
-
status = fsp_set_smb_fname(fsp, smb_fname);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(lck);
bool setup_poll = false;
bool ok;
- SMB_ASSERT(fsp->dirfsp == conn->cwd_fsp);
-
if (conn->printer) {
/*
* Printers are handled completely differently.
goto fail;
}
- fsp->dirfsp = fsp->conn->cwd_fsp;
-
if (base_fsp) {
/*
* We're opening the stream element of a