s3: torture: Change cmd_link to call SMB_VFS_LINKAT().
authorJeremy Allison <jra@samba.org>
Fri, 16 Aug 2019 23:14:03 +0000 (16:14 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 20 Aug 2019 21:09:28 +0000 (21:09 +0000)
Use conn->cwd_fsp as current src and dst fsp's.

No logic change for now.

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

index e4288240922441805b9d9f38cee8a2ad7c630feb..b7b52d4de494388c9afa869a33891daf63f87fae 100644 (file)
@@ -1213,6 +1213,7 @@ static NTSTATUS cmd_link(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
 {
        struct smb_filename *old_smb_fname = NULL;
        struct smb_filename *new_smb_fname = NULL;
+       int ret;
 
        if (argc != 3) {
                printf("Usage: link <path> <link>\n");
@@ -1232,7 +1233,13 @@ static NTSTATUS cmd_link(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (SMB_VFS_LINK(vfs->conn, old_smb_fname, new_smb_fname) == -1) {
+       ret = SMB_VFS_LINKAT(vfs->conn,
+                       vfs->conn->cwd_fsp,
+                       old_smb_fname,
+                       vfs->conn->cwd_fsp,
+                       new_smb_fname,
+                       0);
+       if (ret == -1) {
                printf("link: error=%d (%s)\n", errno, strerror(errno));
                return NT_STATUS_UNSUCCESSFUL;
        }