From bd472a542acab7b16c0dd8e0b017b9dd6fc96ad2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Apr 2007 06:38:45 +0000 Subject: r22123: Try and fix the csc (#4404) bug by supporting the extended response to NTCreateX - need to fix this also for pipe open and NTTransCreate as well so this isn't finished. Jeremy. (This used to be commit be742f248178ae606dfa3a90c6148a18b42128e3) --- source3/smbd/nttrans.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 51ed081edb..9094519b3e 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -847,13 +847,12 @@ int reply_ntcreate_and_X(connection_struct *conn, extended_oplock_granted = True; } -#if 0 - /* W2K sends back 42 words here ! If we do the same it breaks offline sync. Go figure... ? JRA. */ - set_message(outbuf,42,0,True); -#else - set_message(outbuf,34,0,True); -#endif - + if (flags & EXTENDED_RESPONSE_REQUIRED) { + set_message(outbuf,42,0,True); + } else { + set_message(outbuf,34,0,True); + } + p = outbuf + smb_vwv2; /* @@ -914,6 +913,18 @@ int reply_ntcreate_and_X(connection_struct *conn, p += 4; SCVAL(p,0,fsp->is_directory ? 1 : 0); + /* Fixme - we must do the same for NTTransCreate and pipe open. */ + if (flags & EXTENDED_RESPONSE_REQUIRED) { + uint32 perms = 0; + p += 26; + if (fsp->is_directory || can_write_to_file(conn, fname, &sbuf)) { + perms = FILE_GENERIC_ALL; + } else { + perms = FILE_GENERIC_READ|FILE_EXECUTE; + } + SIVAL(p,0,perms); + } + DEBUG(5,("reply_ntcreate_and_X: fnum = %d, open name = %s\n", fsp->fnum, fsp->fsp_name)); result = chain_reply(inbuf,outbuf,length,bufsize); -- cgit