r20338: Restructure open_directory a bit. This gets rid of a race condition regarding
authorVolker Lendecke <vlendec@samba.org>
Sun, 24 Dec 2006 11:13:32 +0000 (11:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:16:42 +0000 (12:16 -0500)
commit472fb11f4968d30cedc9851215c63acd3132f3db
tree1ebad8ded5bc8f6e95138ee71c054a0317cbb27c
parent165d28f03a82a1a07d0f86c0d5de4a785ea5c7f0
r20338: Restructure open_directory a bit. This gets rid of a race condition regarding
error messages: We relied upon a stat that a directory did not exist to later
on then do the mkdir or not. This does the mkdir directly and copes with a
potential error.

The second one is more important: It's possible with Samba 3 to do a
ntcreate&x with NTCREATEX_OPTIONS_DIRECTORY and we happily do a NT_STATUS_OK.

Also move up the use_nt_status() logic a bit. I think this does not belong
into the core routines, the smb server as such should take care of it.

Jeremy, do you think this should go to 3.0.24?

I'll update samba4torture when the build farm has picked up this checkin.

Volker
source/smbd/nttrans.c
source/smbd/open.c
source/smbd/reply.c