diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-23 10:07:29 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-12-13 13:48:25 +0100 |
commit | 688f91e366a983d102111193d85e5671d951d13f (patch) | |
tree | 7116f41e8797ef272239ebea295aa999604e71a6 | |
parent | a988dcb90c4136baf4303700852d78b28e549970 (diff) | |
download | samba-688f91e366a983d102111193d85e5671d951d13f.tar.gz |
vfs_error_inject: add pwrite
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 55a82f907f6410ff478e82b0cf7f1caeacaf5ddd)
-rw-r--r-- | source3/modules/vfs_error_inject.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/modules/vfs_error_inject.c b/source3/modules/vfs_error_inject.c index bb5477a449f..9f0a25fb73f 100644 --- a/source3/modules/vfs_error_inject.c +++ b/source3/modules/vfs_error_inject.c @@ -88,8 +88,26 @@ static int vfs_error_inject_chdir(vfs_handle_struct *handle, return SMB_VFS_NEXT_CHDIR(handle, smb_fname); } +static ssize_t vfs_error_inject_pwrite(vfs_handle_struct *handle, + files_struct *fsp, + const void *data, + size_t n, + off_t offset) +{ + int error; + + error = inject_unix_error("pwrite", handle); + if (error != 0) { + errno = error; + return -1; + } + + return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset); +} + static struct vfs_fn_pointers vfs_error_inject_fns = { .chdir_fn = vfs_error_inject_chdir, + .pwrite_fn = vfs_error_inject_pwrite, }; static_decl_vfs; |