summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/VFS/skel_opaque.c10
-rw-r--r--examples/VFS/skel_transparent.c11
-rw-r--r--source3/include/vfs.h12
-rw-r--r--source3/include/vfs_macros.h5
-rw-r--r--source3/modules/vfs_ceph.c15
-rw-r--r--source3/modules/vfs_ceph_snapshots.c39
-rw-r--r--source3/modules/vfs_default.c14
-rw-r--r--source3/modules/vfs_full_audit.c24
-rw-r--r--source3/modules/vfs_glusterfs.c35
-rw-r--r--source3/modules/vfs_glusterfs_fuse.c36
-rw-r--r--source3/modules/vfs_gpfs.c83
-rw-r--r--source3/modules/vfs_not_implemented.c12
-rw-r--r--source3/modules/vfs_shadow_copy2.c103
-rw-r--r--source3/modules/vfs_snapper.c45
-rw-r--r--source3/modules/vfs_time_audit.c26
-rw-r--r--source3/smbd/vfs.c11
16 files changed, 1 insertions, 480 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index bc18a07478b..3c511ead769 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -651,15 +651,6 @@ static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
return NT_STATUS_NOT_IMPLEMENTED;
}
-static NTSTATUS skel_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
static NTSTATUS skel_get_real_filename_at(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,
@@ -1053,7 +1044,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.set_compression_fn = skel_set_compression,
.fstreaminfo_fn = skel_fstreaminfo,
- .get_real_filename_fn = skel_get_real_filename,
.get_real_filename_at_fn = skel_get_real_filename_at,
.connectpath_fn = skel_connectpath,
.brl_lock_windows_fn = skel_brl_lock_windows,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 52d95235d1c..43d5e818378 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -875,16 +875,6 @@ static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
streams);
}
-static NTSTATUS skel_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
- path, name, mem_ctx, found_name);
-}
-
static NTSTATUS skel_get_real_filename_at(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,
@@ -1369,7 +1359,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.set_compression_fn = skel_set_compression,
.fstreaminfo_fn = skel_fstreaminfo,
- .get_real_filename_fn = skel_get_real_filename,
.get_real_filename_at_fn = skel_get_real_filename_at,
.connectpath_fn = skel_connectpath,
.brl_lock_windows_fn = skel_brl_lock_windows,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 716b9f02fce..316a6c0ec73 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -370,6 +370,7 @@
* Version 47 - remove (unused) struct lock_struct last_lock_failure
from files_struct.
* Version 47 - Add SMB_VFS_GET_REAL_FILENAME_AT
+ * Version 47 - Replace SMB_VFS_GET_REAL_FILENAME with SMB_VFS_GET_REAL_FILENAME_AT
*/
#define SMB_VFS_INTERFACE_VERSION 47
@@ -1148,12 +1149,6 @@ struct vfs_fn_pointers {
unsigned int *num_streams,
struct stream_struct **streams);
- NTSTATUS (*get_real_filename_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name);
-
NTSTATUS (*get_real_filename_at_fn)(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,
@@ -1623,11 +1618,6 @@ NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
unsigned int *num_streams,
struct stream_struct **streams);
-NTSTATUS smb_vfs_call_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name);
NTSTATUS smb_vfs_call_get_real_filename_at(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 29cbaaba5c1..43cfee814fd 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -367,11 +367,6 @@
#define SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, num_streams, streams) \
smb_vfs_call_fstreaminfo(handle->next, (fsp), (mem_ctx), (num_streams), (streams))
-#define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) \
- smb_vfs_call_get_real_filename((conn)->vfs_handles, (path), (name), (mem_ctx), (found_name))
-#define SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx, found_name) \
- smb_vfs_call_get_real_filename((handle)->next, (path), (name), (mem_ctx), (found_name))
-
#define SMB_VFS_GET_REAL_FILENAME_AT(conn, dirfsp, name, mem_ctx, found_name) \
smb_vfs_call_get_real_filename_at( \
(conn)->vfs_handles, \
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index b2f38c2be3b..8132f5ba8b1 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1272,20 +1272,6 @@ static int cephwrap_fchflags(struct vfs_handle_struct *handle,
return -1;
}
-static NTSTATUS cephwrap_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- /*
- * Don't fall back to get_real_filename so callers can differentiate
- * between a full directory scan and an actual case-insensitive stat.
- */
- return NT_STATUS_NOT_SUPPORTED;
-}
-
static NTSTATUS cephwrap_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -1648,7 +1634,6 @@ static struct vfs_fn_pointers ceph_fns = {
.mknodat_fn = cephwrap_mknodat,
.realpath_fn = cephwrap_realpath,
.fchflags_fn = cephwrap_fchflags,
- .get_real_filename_fn = cephwrap_get_real_filename,
.get_real_filename_at_fn = cephwrap_get_real_filename_at,
.connectpath_fn = cephwrap_connectpath,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index d86f7fe0610..06ef5538450 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -1313,44 +1313,6 @@ static int ceph_snap_gmt_fsetxattr(struct vfs_handle_struct *handle,
aname, value, size, flags);
}
-static NTSTATUS ceph_snap_gmt_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- time_t timestamp = 0;
- char stripped[PATH_MAX + 1];
- char conv[PATH_MAX + 1];
- struct smb_filename conv_fname;
- int ret;
- NTSTATUS status;
-
- ret = ceph_snap_gmt_strip_snapshot(handle, path,
- &timestamp, stripped, sizeof(stripped));
- if (ret < 0) {
- return map_nt_error_from_unix(-ret);
- }
- if (timestamp == 0) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
- mem_ctx, found_name);
- }
- ret = ceph_snap_gmt_convert_dir(handle, stripped,
- timestamp, conv, sizeof(conv));
- if (ret < 0) {
- return map_nt_error_from_unix(-ret);
- }
-
- conv_fname = (struct smb_filename) {
- .base_name = conv,
- };
-
- status = SMB_VFS_NEXT_GET_REAL_FILENAME(
- handle, &conv_fname, name, mem_ctx, found_name);
- return status;
-}
-
static NTSTATUS ceph_snap_gmt_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -1513,7 +1475,6 @@ static struct vfs_fn_pointers ceph_snap_fns = {
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.fsetxattr_fn = ceph_snap_gmt_fsetxattr,
.fchflags_fn = ceph_snap_gmt_fchflags,
- .get_real_filename_fn = ceph_snap_gmt_get_real_filename,
.get_real_filename_at_fn = ceph_snap_gmt_get_real_filename_at,
};
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index ca928ded260..400bd98cacb 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -3358,19 +3358,6 @@ static NTSTATUS vfswrap_fstreaminfo(vfs_handle_struct *handle,
return NT_STATUS_OK;
}
-static NTSTATUS vfswrap_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- /*
- * Don't fall back to get_real_filename so callers can differentiate
- * between a full directory scan and an actual case-insensitive stat.
- */
- return NT_STATUS_NOT_SUPPORTED;
-}
-
static NTSTATUS vfswrap_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -4029,7 +4016,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
.file_id_create_fn = vfswrap_file_id_create,
.fs_file_id_fn = vfswrap_fs_file_id,
.fstreaminfo_fn = vfswrap_fstreaminfo,
- .get_real_filename_fn = vfswrap_get_real_filename,
.get_real_filename_at_fn = vfswrap_get_real_filename_at,
.connectpath_fn = vfswrap_connectpath,
.brl_lock_windows_fn = vfswrap_brl_lock_windows,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index c57366a533e..dc013e7e3a1 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -2082,29 +2082,6 @@ static NTSTATUS smb_full_audit_fstreaminfo(vfs_handle_struct *handle,
return result;
}
-static NTSTATUS smb_full_audit_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- NTSTATUS result;
-
- result = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx,
- found_name);
-
- do_log(SMB_VFS_OP_GET_REAL_FILENAME,
- NT_STATUS_IS_OK(result),
- handle,
- "%s/%s->%s",
- path->base_name,
- name,
- NT_STATUS_IS_OK(result) ? *found_name : "");
-
- return result;
-}
-
static NTSTATUS smb_full_audit_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -3016,7 +2993,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.snap_create_fn = smb_full_audit_snap_create,
.snap_delete_fn = smb_full_audit_snap_delete,
.fstreaminfo_fn = smb_full_audit_fstreaminfo,
- .get_real_filename_fn = smb_full_audit_get_real_filename,
.get_real_filename_at_fn = smb_full_audit_get_real_filename_at,
.connectpath_fn = smb_full_audit_connectpath,
.brl_lock_windows_fn = smb_full_audit_brl_lock_windows,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index c30c19344f7..f526d413373 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1999,40 +1999,6 @@ static int vfs_gluster_fchflags(struct vfs_handle_struct *handle,
return -1;
}
-static NTSTATUS vfs_gluster_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- int ret;
- char key_buf[GLUSTER_NAME_MAX + 64];
- char val_buf[GLUSTER_NAME_MAX + 1];
-
- if (strlen(name) >= GLUSTER_NAME_MAX) {
- return NT_STATUS_OBJECT_NAME_INVALID;
- }
-
- snprintf(key_buf, GLUSTER_NAME_MAX + 64,
- "glusterfs.get_real_filename:%s", name);
-
- ret = glfs_getxattr(handle->data, path->base_name, key_buf, val_buf,
- GLUSTER_NAME_MAX + 1);
- if (ret == -1) {
- if (errno == ENOATTR) {
- errno = ENOENT;
- }
- return map_nt_error_from_unix(errno);
- }
-
- *found_name = talloc_strdup(mem_ctx, val_buf);
- if (found_name[0] == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- return NT_STATUS_OK;
-}
-
static NTSTATUS vfs_gluster_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -2404,7 +2370,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
.fchflags_fn = vfs_gluster_fchflags,
.file_id_create_fn = NULL,
.fstreaminfo_fn = NULL,
- .get_real_filename_fn = vfs_gluster_get_real_filename,
.get_real_filename_at_fn = vfs_gluster_get_real_filename_at,
.connectpath_fn = vfs_gluster_connectpath,
.create_dfs_pathat_fn = vfs_gluster_create_dfs_pathat,
diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c
index 08abf9316b5..3eb4dc27d54 100644
--- a/source3/modules/vfs_glusterfs_fuse.c
+++ b/source3/modules/vfs_glusterfs_fuse.c
@@ -23,41 +23,6 @@
#define GLUSTER_NAME_MAX 255
-static NTSTATUS vfs_gluster_fuse_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **_found_name)
-{
- int ret;
- char key_buf[GLUSTER_NAME_MAX + 64];
- char val_buf[GLUSTER_NAME_MAX + 1];
- char *found_name = NULL;
-
- if (strlen(name) >= GLUSTER_NAME_MAX) {
- return NT_STATUS_OBJECT_NAME_INVALID;
- }
-
- snprintf(key_buf, GLUSTER_NAME_MAX + 64,
- "glusterfs.get_real_filename:%s", name);
-
- ret = getxattr(path->base_name, key_buf, val_buf, GLUSTER_NAME_MAX + 1);
- if (ret == -1) {
- if (errno == ENOATTR) {
- errno = ENOENT;
- }
- return map_nt_error_from_unix(errno);
- }
-
- found_name = talloc_strdup(mem_ctx, val_buf);
- if (found_name == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- *_found_name = found_name;
- return NT_STATUS_OK;
-}
-
static NTSTATUS vfs_gluster_fuse_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -296,7 +261,6 @@ static int vfs_glusterfs_fuse_connect(struct vfs_handle_struct *handle,
struct vfs_fn_pointers glusterfs_fuse_fns = {
.connect_fn = vfs_glusterfs_fuse_connect,
- .get_real_filename_fn = vfs_gluster_fuse_get_real_filename,
.get_real_filename_at_fn = vfs_gluster_fuse_get_real_filename_at,
.file_id_create_fn = vfs_glusterfs_fuse_file_id_create,
};
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 0402323f048..43c625c3290 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -288,88 +288,6 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle,
}
#endif /* HAVE_KERNEL_OPLOCKS_LINUX */
-static NTSTATUS vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- int result;
- char *full_path = NULL;
- char *to_free = NULL;
- char real_pathname[PATH_MAX+1], tmpbuf[PATH_MAX];
- size_t full_path_len;
- int buflen;
- bool mangled;
- struct gpfs_config_data *config;
-
- SMB_VFS_HANDLE_GET_DATA(handle, config,
- struct gpfs_config_data,
- return NT_STATUS_INTERNAL_ERROR);
-
- if (!config->getrealfilename) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
- mem_ctx, found_name);
- }
-
- mangled = mangle_is_mangled(name, handle->conn->params);
- if (mangled) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
- mem_ctx, found_name);
- }
-
- full_path_len = full_path_tos(path->base_name, name,
- tmpbuf, sizeof(tmpbuf),
- &full_path, &to_free);
- if (full_path_len == -1) {
- return NT_STATUS_NO_MEMORY;
- }
-
- buflen = sizeof(real_pathname) - 1;
-
- result = gpfswrap_get_realfilename_path(full_path, real_pathname,
- &buflen);
-
- TALLOC_FREE(to_free);
-
- if ((result == -1) && (errno == ENOSYS)) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(
- handle, path, name, mem_ctx, found_name);
- }
-
- if (result == -1) {
- DEBUG(10, ("smbd_gpfs_get_realfilename_path returned %s\n",
- strerror(errno)));
- return map_nt_error_from_unix(errno);
- }
-
- /*
- * GPFS does not necessarily null-terminate the returned path
- * but instead returns the buffer length in buflen.
- */
-
- if (buflen < sizeof(real_pathname)) {
- real_pathname[buflen] = '\0';
- } else {
- real_pathname[sizeof(real_pathname)-1] = '\0';
- }
-
- DEBUG(10, ("smbd_gpfs_get_realfilename_path: %s/%s -> %s\n",
- path->base_name, name, real_pathname));
-
- name = strrchr_m(real_pathname, '/');
- if (name == NULL) {
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
- }
-
- *found_name = talloc_strdup(mem_ctx, name+1);
- if (*found_name == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
- return NT_STATUS_OK;
-}
-
static NTSTATUS vfs_gpfs_get_real_filename_at(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,
@@ -2634,7 +2552,6 @@ static struct vfs_fn_pointers vfs_gpfs_fns = {
.fs_capabilities_fn = vfs_gpfs_capabilities,
.filesystem_sharemode_fn = vfs_gpfs_filesystem_sharemode,
.linux_setlease_fn = vfs_gpfs_setlease,
- .get_real_filename_fn = vfs_gpfs_get_real_filename,
.get_real_filename_at_fn = vfs_gpfs_get_real_filename_at,
.get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
.get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 0a69f94c665..9c72e417f26 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -724,17 +724,6 @@ NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
}
_PUBLIC_
-NTSTATUS vfs_not_implemented_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-_PUBLIC_
NTSTATUS vfs_not_implemented_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -1159,7 +1148,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
.set_compression_fn = vfs_not_implemented_set_compression,
.fstreaminfo_fn = vfs_not_implemented_fstreaminfo,
- .get_real_filename_fn = vfs_not_implemented_get_real_filename,
.get_real_filename_at_fn = vfs_not_implemented_get_real_filename_at,
.connectpath_fn = vfs_not_implemented_connectpath,
.brl_lock_windows_fn = vfs_not_implemented_brl_lock_windows,
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 673baf55651..62c6df5ce72 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -2500,108 +2500,6 @@ static NTSTATUS shadow_copy2_read_dfs_pathat(struct vfs_handle_struct *handle,
return status;
}
-static NTSTATUS shadow_copy2_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- struct shadow_copy2_private *priv = NULL;
- struct shadow_copy2_config *config = NULL;
- time_t timestamp = 0;
- char *stripped = NULL;
- char *conv;
- struct smb_filename conv_fname;
- NTSTATUS status;
-
- SMB_VFS_HANDLE_GET_DATA(handle, priv, struct shadow_copy2_private,
- return NT_STATUS_INTERNAL_ERROR);
- config = priv->config;
-
- DBG_DEBUG("Path=[%s] name=[%s]\n", smb_fname_str_dbg(fname), name);
-
- if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
- &timestamp, &stripped)) {
- status = map_nt_error_from_unix(errno);
- DEBUG(10, ("shadow_copy2_strip_snapshot failed\n"));
- return status;
- }
- if (timestamp == 0) {
- DEBUG(10, ("timestamp == 0\n"));
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, fname, name,
- mem_ctx, found_name);
- }
-
- /*
- * Note that stripped may be an empty string "" if path was ".". As
- * shadow_copy2_convert() combines "" with the shadow-copy tree connect
- * root fullpath and get_real_filename_full_scan() has an explicit check
- * for "" this works.
- */
- DBG_DEBUG("stripped [%s]\n", stripped);
-
- conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
- if (conv == NULL) {
- status = map_nt_error_from_unix(errno);
-
- if (!config->snapdirseverywhere) {
- DBG_DEBUG("shadow_copy2_convert [%s] failed\n", stripped);
- return status;
- }
-
- /*
- * We're called in the path traversal loop in unix_convert()
- * walking down the directory hierarchy. shadow_copy2_convert()
- * will fail if the snapshot directory is futher down in the
- * hierachy. Set conv to the original stripped path and try to
- * look it up in the filesystem with
- * SMB_VFS_NEXT_GET_REAL_FILENAME() or
- * get_real_filename_full_scan().
- */
- DBG_DEBUG("Use stripped [%s] as conv\n", stripped);
- conv = talloc_strdup(talloc_tos(), stripped);
- if (conv == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- }
-
- conv_fname = (struct smb_filename) {
- .base_name = conv,
- };
-
- DEBUG(10, ("Calling NEXT_GET_REAL_FILE_NAME for conv=[%s], "
- "name=[%s]\n", conv, name));
- status = SMB_VFS_NEXT_GET_REAL_FILENAME(
- handle, &conv_fname, name, mem_ctx, found_name);
- DEBUG(10, ("NEXT_REAL_FILE_NAME returned %s\n", nt_errstr(status)));
- if (NT_STATUS_IS_OK(status)) {
- return NT_STATUS_OK;
- }
- if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
- TALLOC_FREE(conv);
- return NT_STATUS_NOT_SUPPORTED;
- }
-
- status = get_real_filename_full_scan(handle->conn,
- conv,
- name,
- false,
- mem_ctx,
- found_name);
- if (!NT_STATUS_IS_OK(status)) {
- DBG_DEBUG("Scan [%s] for [%s] failed\n",
- conv, name);
- return status;
- }
-
- DBG_DEBUG("Scan [%s] for [%s] returned [%s]\n",
- conv, name, *found_name);
-
- TALLOC_FREE(conv);
- return NT_STATUS_OK;
-}
-
static NTSTATUS shadow_copy2_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -3540,7 +3438,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
.mkdirat_fn = shadow_copy2_mkdirat,
.fsetxattr_fn = shadow_copy2_fsetxattr,
.fchflags_fn = shadow_copy2_fchflags,
- .get_real_filename_fn = shadow_copy2_get_real_filename,
.get_real_filename_at_fn = shadow_copy2_get_real_filename_at,
.pwrite_fn = shadow_copy2_pwrite,
.pwrite_send_fn = shadow_copy2_pwrite_send,
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 3cbdb35642f..15707ac0304 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -2433,50 +2433,6 @@ static int snapper_gmt_fsetxattr(struct vfs_handle_struct *handle,
aname, value, size, flags);
}
-static NTSTATUS snapper_gmt_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *fpath,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- time_t timestamp;
- char *stripped;
- char *conv;
- struct smb_filename conv_fname;
- NTSTATUS status;
-
- if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fpath,
- &timestamp, &stripped)) {
- return NT_STATUS_NO_MEMORY;
- }
- if (timestamp == 0) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, fpath, name,
- mem_ctx, found_name);
- }
- if (stripped[0] == '\0') {
- *found_name = talloc_strdup(mem_ctx, name);
- if (*found_name == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- return NT_STATUS_OK;
- }
- conv = snapper_gmt_convert(talloc_tos(), handle, stripped, timestamp);
- TALLOC_FREE(stripped);
- if (conv == NULL) {
- return map_nt_error_from_unix(errno);
- }
-
- conv_fname = (struct smb_filename) {
- .base_name = conv,
- };
-
- status = SMB_VFS_NEXT_GET_REAL_FILENAME(
- handle, &conv_fname, name, mem_ctx, found_name);
- TALLOC_FREE(conv);
- return status;
-}
-
static NTSTATUS snapper_gmt_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -2682,7 +2638,6 @@ static struct vfs_fn_pointers snapper_fns = {
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.fsetxattr_fn = snapper_gmt_fsetxattr,
.fchflags_fn = snapper_gmt_fchflags,
- .get_real_filename_fn = snapper_gmt_get_real_filename,
.get_real_filename_at_fn = snapper_gmt_get_real_filename_at,
};
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index b40f9ff00ef..4f9ad52592f 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -1717,31 +1717,6 @@ static NTSTATUS smb_time_audit_fstreaminfo(vfs_handle_struct *handle,
return result;
}
-static NTSTATUS smb_time_audit_get_real_filename(
- struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- NTSTATUS result;
- struct timespec ts1,ts2;
- double timediff;
-
- clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx,
- found_name);
- clock_gettime_mono(&ts2);
- timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
- if (timediff > audit_timeout) {
- smb_time_audit_log_fname("get_real_filename",
- timediff, path->base_name);
- }
-
- return result;
-}
-
static NTSTATUS smb_time_audit_get_real_filename_at(
struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
@@ -2829,7 +2804,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.snap_create_fn = smb_time_audit_snap_create,
.snap_delete_fn = smb_time_audit_snap_delete,
.fstreaminfo_fn = smb_time_audit_fstreaminfo,
- .get_real_filename_fn = smb_time_audit_get_real_filename,
.get_real_filename_at_fn = smb_time_audit_get_real_filename_at,
.connectpath_fn = smb_time_audit_connectpath,
.brl_lock_windows_fn = smb_time_audit_brl_lock_windows,
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 68a97ace038..6ae68cdf878 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -2261,17 +2261,6 @@ NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle,
num_streams, streams);
}
-NTSTATUS smb_vfs_call_get_real_filename(struct vfs_handle_struct *handle,
- const struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name)
-{
- VFS_FIND(get_real_filename);
- return handle->fns->get_real_filename_fn(handle, path, name, mem_ctx,
- found_name);
-}
-
NTSTATUS smb_vfs_call_get_real_filename_at(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const char *name,