smbd: Fix an error path in open_directory
authorVolker Lendecke <vl@samba.org>
Mon, 7 Oct 2013 20:13:28 +0000 (20:13 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 8 Oct 2013 23:58:55 +0000 (01:58 +0200)
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct  9 01:58:55 CEST 2013 on sn-devel-104

source3/smbd/open.c

index 55f2fb2164758d12134b0e5529e546df83789621..5024c902858314532842124fcbbf2ac2ee774272 100644 (file)
@@ -3190,6 +3190,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);