From: Jeremy Allison Date: Wed, 26 May 2021 18:40:32 +0000 (-0700) Subject: s3: smbd: copy_internals(). parent_smb_fname() -> SMB_VFS_PARENT_PATHNAME(). X-Git-Tag: tevent-0.11.0~677 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0dde001c369743c3a5078134461f98c1eee471fa;p=thirdparty%2Fsamba.git s3: smbd: copy_internals(). parent_smb_fname() -> SMB_VFS_PARENT_PATHNAME(). Off-topic. This function is insane and should be removed.. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 00f551595d7..75162b5f61c 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1570,7 +1570,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, NTSTATUS status = NT_STATUS_OK; struct smb_filename *parent = NULL; struct smb_filename *pathref = NULL; - bool ok; if (!CAN_WRITE(conn)) { status = NT_STATUS_MEDIA_WRITE_PROTECTED; @@ -1678,12 +1677,12 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, creates the file. This isn't the correct thing to do in the copy case. JRA */ - ok = parent_smb_fname(talloc_tos(), - smb_fname_dst, - &parent, - NULL); - if (!ok) { - status = NT_STATUS_NO_MEMORY; + status = SMB_VFS_PARENT_PATHNAME(conn, + talloc_tos(), + smb_fname_dst, + &parent, + NULL); + if (!NT_STATUS_IS_OK(status)) { goto out; } if (smb_fname_dst->fsp == NULL) {