1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s3: VFS: vfs_snapper. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-08-21 11:03:41 -07:00
parent 1aead2fe25
commit 4ce3cd3100

View File

@ -2400,6 +2400,30 @@ static int snapper_gmt_mknod(vfs_handle_struct *handle,
return SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
}
static int snapper_gmt_mknodat(vfs_handle_struct *handle,
files_struct *dirfsp,
const struct smb_filename *smb_fname,
mode_t mode,
SMB_DEV_T dev)
{
time_t timestamp = (time_t)0;
if (!snapper_gmt_strip_snapshot(talloc_tos(), handle,
smb_fname->base_name,
&timestamp, NULL)) {
return -1;
}
if (timestamp != 0) {
errno = EROFS;
return -1;
}
return SMB_VFS_NEXT_MKNODAT(handle,
dirfsp,
smb_fname,
mode,
dev);
}
static struct smb_filename *snapper_gmt_realpath(vfs_handle_struct *handle,
TALLOC_CTX *ctx,
const struct smb_filename *smb_fname)
@ -2882,6 +2906,7 @@ static struct vfs_fn_pointers snapper_fns = {
.ntimes_fn = snapper_gmt_ntimes,
.readlink_fn = snapper_gmt_readlink,
.mknod_fn = snapper_gmt_mknod,
.mknodat_fn = snapper_gmt_mknodat,
.realpath_fn = snapper_gmt_realpath,
.get_nt_acl_fn = snapper_gmt_get_nt_acl,
.fget_nt_acl_fn = snapper_gmt_fget_nt_acl,