1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

vfstest: Convert cmd_rename to synthetic_smb_fname

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2013-04-15 11:46:24 +02:00 committed by Jeremy Allison
parent 434885a4ac
commit a6985e6e67

View File

@ -550,24 +550,21 @@ static NTSTATUS cmd_rename(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
int ret; int ret;
struct smb_filename *smb_fname_src = NULL; struct smb_filename *smb_fname_src = NULL;
struct smb_filename *smb_fname_dst = NULL; struct smb_filename *smb_fname_dst = NULL;
NTSTATUS status;
if (argc != 3) { if (argc != 3) {
printf("Usage: rename <old> <new>\n"); printf("Usage: rename <old> <new>\n");
return NT_STATUS_OK; return NT_STATUS_OK;
} }
status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL, smb_fname_src = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
&smb_fname_src); if (smb_fname_src == NULL) {
if (!NT_STATUS_IS_OK(status)) { return NT_STATUS_NO_MEMORY;
return status;
} }
status = create_synthetic_smb_fname_split(mem_ctx, argv[2], NULL, smb_fname_dst = synthetic_smb_fname_split(mem_ctx, argv[2], NULL);
&smb_fname_dst); if (smb_fname_dst == NULL) {
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(smb_fname_src); TALLOC_FREE(smb_fname_src);
return status; return NT_STATUS_NO_MEMORY;
} }
ret = SMB_VFS_RENAME(vfs->conn, smb_fname_src, smb_fname_dst); ret = SMB_VFS_RENAME(vfs->conn, smb_fname_src, smb_fname_dst);