s3: torture: vfstest. unlink cmd must be stream aware.
authorJeremy Allison <jra@samba.org>
Thu, 20 Oct 2016 20:33:09 +0000 (13:33 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 20 Oct 2016 23:04:10 +0000 (01:04 +0200)
Otherwise the following patch breaks vfstest stream-depot test.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12384

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/torture/cmd_vfs.c

index 12610cf8f3c2b9cb6f6b7f9397381c736542c8c9..b57a061ee4c8165049c7e46e4eab8ca3cdabe90e 100644 (file)
@@ -442,6 +442,14 @@ static NTSTATUS cmd_pathfunc(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int arg
                ret = SMB_VFS_RMDIR(vfs->conn, smb_fname);
                TALLOC_FREE(smb_fname);
        } else if (strcmp("unlink", argv[0]) == 0 ) {
+               TALLOC_FREE(smb_fname);
+               /* unlink can be a stream:name */
+               smb_fname = synthetic_smb_fname_split(talloc_tos(),
+                                       argv[1],
+                                       lp_posix_pathnames());
+               if (smb_fname == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
                ret = SMB_VFS_UNLINK(vfs->conn, smb_fname);
                TALLOC_FREE(smb_fname);
        } else if (strcmp("chdir", argv[0]) == 0 ) {