]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfstest: use filename_convert() in cmd_utime()
authorRalph Boehme <slow@samba.org>
Wed, 28 Oct 2020 10:31:46 +0000 (11:31 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Ensures we have a pathref fsp when calling SMB_VFS_NTIMES().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/cmd_vfs.c

index da58c0cee0de191ed43a2543f15a3ea36c9fbb69..b47cdea4929168066e7007c9a397a21695adf818 100644 (file)
@@ -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 <path> <access> <modify>\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) {