[PATCH] smbd: Fix an error path in open_directory

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 7 14:17:01 MDT 2013


While doing the set_share_mode simplifications I discovered
an asymmetry between open_file_ntcreate and open_directory.
Please see the attached patch, review & push.

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

*****************************************************************
visit us on it-sa:IT security exhibitions in Nürnberg, Germany
October 8th - 10th 2013, hall 12, booth 333
free tickets available via code 270691 on: www.it-sa.de/gutschein
******************************************************************
-------------- next part --------------
From a87715da391af8819e393d053c61e06db16800f2 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 7 Oct 2013 20:13:28 +0000
Subject: [PATCH] smbd: Fix an error path in open_directory

In open_file_ntcreate we do the del_share_mode on error. We should do
it here as well.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/open.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 858d2be..b1c736a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3181,6 +3181,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 	if (create_options & FILE_DELETE_ON_CLOSE) {
 		status = can_set_delete_on_close(fsp, 0);
 		if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_DIRECTORY_NOT_EMPTY)) {
+			del_share_mode(lck, fsp);
 			TALLOC_FREE(lck);
 			fd_close(fsp);
 			file_free(req, fsp);
-- 
1.7.9.5



More information about the samba-technical mailing list