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)
commit469b42c61f73c0bd5166c33a909b3c68c1fb9dde
treeb4a474879e9d7f9145bcb8e59c508b88d139edfb
parent57d11622b55faddd14b3a6e32dca8f56d18280fb
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
(This used to be commit 472fb11f4968d30cedc9851215c63acd3132f3db)
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/reply.c