diff options
author | Jeremy Allison <jra@samba.org> | 2007-08-15 23:56:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:51 -0500 |
commit | 606f10945fc159d3e12f181b3e5137b3e035c450 (patch) | |
tree | 39729eaefa4d0620a8fbfd4cee9c4e76948021b2 | |
parent | fd9c413786e54f07a1db992c2a103c6f1be832e2 (diff) | |
download | samba-606f10945fc159d3e12f181b3e5137b3e035c450.tar.gz samba-606f10945fc159d3e12f181b3e5137b3e035c450.tar.bz2 samba-606f10945fc159d3e12f181b3e5137b3e035c450.zip |
r24474: Map error value NT_STATUS_OBJECT_NAME_COLLISION
to ERRDOS, ERRfilexists for NTCreateX and NTTransCreate.
Jeremy.
(This used to be commit 5b2316d1734765ef6c31ff09beea974d9629d17f)
-rw-r--r-- | source3/smbd/nttrans.c | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 1b6c324e9d..23905181cd 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -788,18 +788,6 @@ void reply_ntcreate_and_X(connection_struct *conn, file_attributes, &info, &fsp); - TALLOC_FREE(case_state); - - if(!NT_STATUS_IS_OK(status)) { - if (!use_nt_status() && NT_STATUS_EQUAL( - status, NT_STATUS_OBJECT_NAME_COLLISION)) { - status = NT_STATUS_DOS(ERRDOS, ERRfilexists); - } - reply_nterror(req, status); - END_PROFILE(SMBntcreateX); - return; - } - } else { /* @@ -861,7 +849,7 @@ void reply_ntcreate_and_X(connection_struct *conn, END_PROFILE(SMBntcreateX); return; } - + oplock_request = 0; status = open_directory(conn, req, fname, &sbuf, @@ -872,31 +860,33 @@ void reply_ntcreate_and_X(connection_struct *conn, file_attributes, &info, &fsp); - if(!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(case_state); - if (!use_nt_status() && NT_STATUS_EQUAL( - status, NT_STATUS_OBJECT_NAME_COLLISION)) { - status = NT_STATUS_DOS(ERRDOS, ERRfilexists); - } - reply_nterror(req, status); - END_PROFILE(SMBntcreateX); - return; - } - } else { - TALLOC_FREE(case_state); - END_PROFILE(SMBntcreateX); - if (open_was_deferred(req->mid)) { - /* We have re-scheduled this call. */ - return; - } - reply_nterror(req, status); - return; } - } + } } - + TALLOC_FREE(case_state); + if (!NT_STATUS_IS_OK(status)) { + END_PROFILE(SMBntcreateX); + if (open_was_deferred(req->mid)) { + /* We have re-scheduled this call. */ + return; + } + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) { + /* + * We hit an existing file, and if we're returning DOS + * error codes OBJECT_NAME_COLLISION would map to + * ERRDOS/183, we need to return ERRDOS/80, see bug + * 4852. + */ + reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION, + ERRDOS, ERRfilexists); + return; + } + reply_nterror(req, status); + return; + } + file_len = sbuf.st_size; fattr = dos_mode(conn,fname,&sbuf); if(fattr == 0) { |