return ret;
}
+static int cap_unlinkat(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ int flags)
+{
+ struct smb_filename *smb_fname_tmp = NULL;
+ char *cappath = NULL;
+ int ret;
+
+ cappath = capencode(talloc_tos(), smb_fname->base_name);
+ if (!cappath) {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ /* Setup temporary smb_filename structs. */
+ smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
+ if (smb_fname_tmp == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ smb_fname_tmp->base_name = cappath;
+
+ ret = SMB_VFS_NEXT_UNLINKAT(handle,
+ dirfsp,
+ smb_fname_tmp,
+ flags);
+
+ TALLOC_FREE(smb_fname_tmp);
+ return ret;
+}
+
static int cap_chmod(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode)
.stat_fn = cap_stat,
.lstat_fn = cap_lstat,
.unlink_fn = cap_unlink,
+ .unlinkat_fn = cap_unlinkat,
.chmod_fn = cap_chmod,
.chown_fn = cap_chown,
.lchown_fn = cap_lchown,