return -1;
}
-static int skel_unlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname)
-{
- errno = ENOSYS;
- return -1;
-}
-
static int skel_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.fstat_fn = skel_fstat,
.lstat_fn = skel_lstat,
.get_alloc_size_fn = skel_get_alloc_size,
- .unlink_fn = skel_unlink,
.unlinkat_fn = skel_unlinkat,
.chmod_fn = skel_chmod,
.fchmod_fn = skel_fchmod,
return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
}
-static int skel_unlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname)
-{
- return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-}
-
static int skel_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.fstat_fn = skel_fstat,
.lstat_fn = skel_lstat,
.get_alloc_size_fn = skel_get_alloc_size,
- .unlink_fn = skel_unlink,
.unlinkat_fn = skel_unlinkat,
.chmod_fn = skel_chmod,
.fchmod_fn = skel_fchmod,
SMBPROFILE_STATS_BASIC(syscall_fstat) \
SMBPROFILE_STATS_BASIC(syscall_lstat) \
SMBPROFILE_STATS_BASIC(syscall_get_alloc_size) \
- SMBPROFILE_STATS_BASIC(syscall_unlink) \
SMBPROFILE_STATS_BASIC(syscall_unlinkat) \
SMBPROFILE_STATS_BASIC(syscall_chmod) \
SMBPROFILE_STATS_BASIC(syscall_fchmod) \
/* Version 42 - Move change_to_user() -> change_to_user_and_service() */
/* Version 42 - Move change_to_user_by_fsp() -> change_to_user_and_service_by_fsp() */
/* Version 42 - Move [un]become_user*() -> [un]become_user_without_service*() */
-/* Version 42 - Add SMB_VFS_UNLINKAT. */
+/* Version 42 - Move SMB_VFS_UNLINK -> SMB_VFS_UNLINKAT. */
#define SMB_VFS_INTERFACE_VERSION 42
int (*fstat_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf);
int (*lstat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename);
uint64_t (*get_alloc_size_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
- int (*unlink_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname);
int (*unlinkat_fn)(struct vfs_handle_struct *handle,
struct files_struct *srcdir_fsp,
const struct smb_filename *smb_fname,
uint64_t smb_vfs_call_get_alloc_size(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const SMB_STRUCT_STAT *sbuf);
-int smb_vfs_call_unlink(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname);
int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const SMB_STRUCT_STAT *sbuf);
-int vfs_not_implemented_unlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname);
int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
#define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
-#define SMB_VFS_UNLINK(conn, path) \
- smb_vfs_call_unlink((conn)->vfs_handles, (path))
-#define SMB_VFS_NEXT_UNLINK(handle, path) \
- smb_vfs_call_unlink((handle)->next, (path))
-
#define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
#define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
return result;
}
-static int vfswrap_unlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname)
-{
- int result = -1;
-
- START_PROFILE(syscall_unlink);
-
- if (smb_fname->stream_name) {
- errno = ENOENT;
- goto out;
- }
- result = unlink(smb_fname->base_name);
-
- out:
- END_PROFILE(syscall_unlink);
- return result;
-}
-
static int vfswrap_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.fstat_fn = vfswrap_fstat,
.lstat_fn = vfswrap_lstat,
.get_alloc_size_fn = vfswrap_get_alloc_size,
- .unlink_fn = vfswrap_unlink,
.unlinkat_fn = vfswrap_unlinkat,
.chmod_fn = vfswrap_chmod,
.fchmod_fn = vfswrap_fchmod,
return -1;
}
-int vfs_not_implemented_unlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname)
-{
- errno = ENOSYS;
- return -1;
-}
-
int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.fstat_fn = vfs_not_implemented_fstat,
.lstat_fn = vfs_not_implemented_lstat,
.get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
- .unlink_fn = vfs_not_implemented_unlink,
.unlinkat_fn = vfs_not_implemented_unlinkat,
.chmod_fn = vfs_not_implemented_chmod,
.fchmod_fn = vfs_not_implemented_fchmod,
return handle->fns->get_alloc_size_fn(handle, fsp, sbuf);
}
-int smb_vfs_call_unlink(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname)
-{
- VFS_FIND(unlink);
- return handle->fns->unlink_fn(handle, smb_fname);
-}
-
int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,