diff options
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_default.c | 25 | ||||
-rw-r--r-- | source3/modules/vfs_not_implemented.c | 10 |
2 files changed, 35 insertions, 0 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index f48a590e5e7..de6d7892d5e 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2222,6 +2222,30 @@ static int vfswrap_unlink(vfs_handle_struct *handle, return result; } +static int vfswrap_unlinkat(vfs_handle_struct *handle, + struct files_struct *dirfsp, + const struct smb_filename *smb_fname, + int flags) +{ + int result = -1; + + START_PROFILE(syscall_unlinkat); + + SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + + if (smb_fname->stream_name) { + errno = ENOENT; + goto out; + } + result = unlinkat(dirfsp->fh->fd, + smb_fname->base_name, + flags); + + out: + END_PROFILE(syscall_unlinkat); + return result; +} + static int vfswrap_chmod(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) @@ -3488,6 +3512,7 @@ static struct vfs_fn_pointers vfs_default_fns = { .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, .chown_fn = vfswrap_chown, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index e0f36b9a632..0c7a8e686f0 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -349,6 +349,15 @@ int vfs_not_implemented_unlink(vfs_handle_struct *handle, return -1; } +int vfs_not_implemented_unlinkat(vfs_handle_struct *handle, + struct files_struct *dirfsp, + const struct smb_filename *smb_fname, + int flags) +{ + errno = ENOSYS; + return -1; +} + int vfs_not_implemented_chmod(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) @@ -1081,6 +1090,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .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, .chown_fn = vfs_not_implemented_chown, |