From: Ralph Boehme Date: Wed, 20 May 2020 21:02:06 +0000 (+0200) Subject: vfs_error_inject: implement SMB_VFS_OPENAT() X-Git-Tag: ldb-2.2.0~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aff66d437e53683c67d10b27b3e85d4e42e80e0;p=thirdparty%2Fsamba.git vfs_error_inject: implement SMB_VFS_OPENAT() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_error_inject.c b/source3/modules/vfs_error_inject.c index c7a99370b2a..c67b622fbe6 100644 --- a/source3/modules/vfs_error_inject.c +++ b/source3/modules/vfs_error_inject.c @@ -122,10 +122,26 @@ static int vfs_error_inject_open( return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode); } +static int vfs_error_inject_openat(struct vfs_handle_struct *handle, + const struct files_struct *dirfsp, + const struct smb_filename *smb_fname, + files_struct *fsp, + int flags, + mode_t mode) +{ + int error = inject_unix_error("openat", handle); + if (error != 0) { + errno = error; + return -1; + } + return SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode); +} + static struct vfs_fn_pointers vfs_error_inject_fns = { .chdir_fn = vfs_error_inject_chdir, .pwrite_fn = vfs_error_inject_pwrite, .open_fn = vfs_error_inject_open, + .openat_fn = vfs_error_inject_openat, }; static_decl_vfs; diff --git a/source3/script/tests/test_open_eintr.sh b/source3/script/tests/test_open_eintr.sh index d08f7fcfc23..8a92744a85c 100755 --- a/source3/script/tests/test_open_eintr.sh +++ b/source3/script/tests/test_open_eintr.sh @@ -42,6 +42,7 @@ head -n 1 <&101 head -n 1 <&102 echo "error_inject:open = EINTR" > ${error_inject_conf} +echo "error_inject:openat = EINTR" >> ${error_inject_conf} ${SMBCONTROL} ${CONF} 0 reload-config sleep 1