From: Ralph Boehme Date: Wed, 28 Oct 2020 10:31:46 +0000 (+0100) Subject: vfstest: use filename_convert() in cmd_utime() X-Git-Tag: samba-4.14.0rc1~296 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c83516f307a9cbcd1663520f772dd1b81119e988;p=thirdparty%2Fsamba.git vfstest: use filename_convert() in cmd_utime() Ensures we have a pathref fsp when calling SMB_VFS_NTIMES(). Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index da58c0cee0d..b47cdea4929 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -1015,6 +1015,7 @@ static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, { struct smb_file_time ft; struct smb_filename *smb_fname = NULL; + NTSTATUS status; if (argc != 4) { printf("Usage: utime \n"); @@ -1026,11 +1027,15 @@ static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, ft.atime = time_t_to_full_timespec(atoi(argv[2])); ft.mtime = time_t_to_full_timespec(atoi(argv[3])); - smb_fname = synthetic_smb_fname_split(mem_ctx, - argv[1], - lp_posix_pathnames()); - if (smb_fname == NULL) { - return NT_STATUS_NO_MEMORY; + status = filename_convert(mem_ctx, + vfs->conn, + argv[1], + 0, + 0, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + printf("utime: %s\n", nt_errstr(status)); + return status; } if (SMB_VFS_NTIMES(vfs->conn, smb_fname, &ft) != 0) {