}
static int skel_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx, char **found_name)
{
}
static int skel_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx, char **found_name)
{
* bool closing
* bool lock_failure_seen
* changed to bitfields.
+ * Version 43 - convert SMB_VFS_GET_REAL_FILENAME() arg path
+ * to be a struct smb_filename
*/
#define SMB_VFS_INTERFACE_VERSION 43
struct stream_struct **streams);
int (*get_real_filename_fn)(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name);
unsigned int *num_streams,
struct stream_struct **streams);
int smb_vfs_call_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name);
unsigned int *num_streams,
struct stream_struct **streams);
int vfs_not_implemented_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name);
}
static int cephwrap_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
}
static int ceph_snap_gmt_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ 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;
- ret = ceph_snap_gmt_strip_snapshot(handle, path,
+ ret = ceph_snap_gmt_strip_snapshot(handle, path->base_name,
×tamp, stripped, sizeof(stripped));
if (ret < 0) {
errno = -ret;
errno = -ret;
return -1;
}
- ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, conv, name,
+
+ conv_fname = (struct smb_filename) {
+ .base_name = conv,
+ };
+
+ ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, &conv_fname, name,
mem_ctx, found_name);
return ret;
}
}
static int vfswrap_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
}
static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
found_name);
do_log(SMB_VFS_OP_GET_REAL_FILENAME, (result == 0), handle,
- "%s/%s->%s", path, name, (result == 0) ? *found_name : "");
+ "%s/%s->%s",
+ path->base_name, name, (result == 0) ? *found_name : "");
return result;
}
}
static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
snprintf(key_buf, GLUSTER_NAME_MAX + 64,
"glusterfs.get_real_filename:%s", name);
- ret = glfs_getxattr(handle->data, path, key_buf, val_buf,
+ ret = glfs_getxattr(handle->data, path->base_name, key_buf, val_buf,
GLUSTER_NAME_MAX + 1);
if (ret == -1) {
if (errno == ENOATTR) {
#define GLUSTER_NAME_MAX 255
static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **_found_name)
snprintf(key_buf, GLUSTER_NAME_MAX + 64,
"glusterfs.get_real_filename:%s", name);
- ret = getxattr(path, key_buf, val_buf, GLUSTER_NAME_MAX + 1);
+ ret = getxattr(path->base_name, key_buf, val_buf, GLUSTER_NAME_MAX + 1);
if (ret == -1) {
if (errno == ENOATTR) {
errno = ENOENT;
}
static int vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
mem_ctx, found_name);
}
- full_path_len = full_path_tos(path, name, tmpbuf, sizeof(tmpbuf),
+ full_path_len = full_path_tos(path->base_name, name,
+ tmpbuf, sizeof(tmpbuf),
&full_path, &to_free);
if (full_path_len == -1) {
errno = ENOMEM;
}
DEBUG(10, ("smbd_gpfs_get_realfilename_path: %s/%s -> %s\n",
- path, name, real_pathname));
+ path->base_name, name, real_pathname));
name = strrchr_m(real_pathname, '/');
if (name == NULL) {
}
int vfs_not_implemented_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
}
static int shadow_copy2_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *fname,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
{
+ char *path = fname->base_name;
time_t timestamp = 0;
char *stripped = NULL;
ssize_t ret;
int saved_errno = 0;
char *conv;
+ struct smb_filename conv_fname;
DEBUG(10, ("shadow_copy2_get_real_filename called for path=[%s], "
"name=[%s]\n", path, name));
}
if (timestamp == 0) {
DEBUG(10, ("timestamp == 0\n"));
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
+ return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, fname, name,
mem_ctx, found_name);
}
conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
DEBUG(10, ("shadow_copy2_convert failed\n"));
return -1;
}
+
+ conv_fname = (struct smb_filename) {
+ .base_name = conv,
+ };
+
DEBUG(10, ("Calling NEXT_GET_REAL_FILE_NAME for conv=[%s], "
"name=[%s]\n", conv, name));
- ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, conv, name,
+ ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, &conv_fname, name,
mem_ctx, found_name);
DEBUG(10, ("NEXT_REAL_FILE_NAME returned %d\n", (int)ret));
if (ret == -1) {
}
static int snapper_gmt_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *fpath,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
{
+ char *path = fpath->base_name;
time_t timestamp;
char *stripped;
ssize_t ret;
int saved_errno;
char *conv;
+ struct smb_filename conv_fname;
if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, path,
×tamp, &stripped)) {
return -1;
}
if (timestamp == 0) {
- return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
+ return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, fpath, name,
mem_ctx, found_name);
}
if (stripped[0] == '\0') {
if (conv == NULL) {
return -1;
}
- ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, conv, name,
+
+ conv_fname = (struct smb_filename) {
+ .base_name = conv,
+ };
+
+ ret = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, &conv_fname, name,
mem_ctx, found_name);
saved_errno = errno;
TALLOC_FREE(conv);
}
static int smb_time_audit_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
- smb_time_audit_log_fname("get_real_filename", timediff, path);
+ smb_time_audit_log_fname("get_real_filename",
+ timediff, path->base_name);
}
return result;
* scanning the whole directory.
*/
ret = SMB_VFS_GET_REAL_FILENAME(dptr->conn,
- dptr->smb_dname->base_name,
+ dptr->smb_dname,
dptr->wcard,
ctx,
&found_name);
/* Try the vfs first to take advantage of case-insensitive stat. */
ret = SMB_VFS_GET_REAL_FILENAME(conn,
- path->base_name,
+ path,
name,
mem_ctx,
found_name);
}
int smb_vfs_call_get_real_filename(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *path,
const char *name,
TALLOC_CTX *mem_ctx,
char **found_name)