1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s3: torture: Change cmd_link to call SMB_VFS_LINKAT().

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>
This commit is contained in:
Jeremy Allison 2019-08-16 16:14:03 -07:00
parent 6b6298b023
commit d4f3d6ce12

View 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;
}