1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3: VFS: vfs_posix_eadb. Implement unlinkat().

Note this isn't identical to unlink() as
this must cope with (flags & AT_REMOVEDIR),
which is identical to rmdir(). It calls
either unlink or rmdir depending on the
flags parameter.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-09-12 12:01:42 -07:00 committed by Ralph Boehme
parent 2a7e472e5c
commit 19c8cfa287

View File

@ -385,6 +385,22 @@ static int posix_eadb_rmdir(vfs_handle_struct *handle,
return ret;
}
static int posix_eadb_unlinkat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
int flags)
{
int ret;
SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
if (flags & AT_REMOVEDIR) {
ret = posix_eadb_rmdir(handle, smb_fname);
} else {
ret = posix_eadb_unlink(handle, smb_fname);
}
return ret;
}
/*
* Destructor for the VFS private data
*/
@ -441,6 +457,7 @@ static struct vfs_fn_pointers vfs_posix_eadb_fns = {
.removexattr_fn = posix_eadb_removexattr,
.fremovexattr_fn = posix_eadb_fremovexattr,
.unlink_fn = posix_eadb_unlink,
.unlinkat_fn = posix_eadb_unlinkat,
.rmdir_fn = posix_eadb_rmdir,
.connect_fn = posix_eadb_connect,
};