[PATCH] Fix libsmb renaming over existing files

Volker Lendecke vl at samba.org
Mon Dec 12 16:04:22 UTC 2016


Hi!

Review appreciated!

Thanks, Volker
-------------- next part --------------
>From 135c746f96b3139c833a66c4b70e810d4fc6b400 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 12 Dec 2016 16:20:29 +0100
Subject: [PATCH] libsmb: Correctly report error for rename failure

This prevents renaming a file over an existing one with SMB2

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/libsmb/cli_smb2_fnum.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 325ae78..5a96b05 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1829,6 +1829,10 @@ fail:
 		cli_smb2_close_fnum(cli, fnum);
 	}
 
+	if (!NT_STATUS_IS_OK(status)) {
+		cli->raw_status = status;
+	}
+
 	TALLOC_FREE(frame);
 	return status;
 }
-- 
2.1.4



More information about the samba-technical mailing list