svn commit: samba r22123 - in branches: SAMBA_3_0/source/include
SAMBA_3_0/source/smbd SAMBA_3_0_25/source/include
SAMBA_3_0_25/source/smbd
jra at samba.org
jra at samba.org
Sat Apr 7 06:38:46 GMT 2007
Author: jra
Date: 2007-04-07 06:38:45 +0000 (Sat, 07 Apr 2007)
New Revision: 22123
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22123
Log:
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.
Modified:
branches/SAMBA_3_0/source/include/smb.h
branches/SAMBA_3_0/source/smbd/nttrans.c
branches/SAMBA_3_0_25/source/include/smb.h
branches/SAMBA_3_0_25/source/smbd/nttrans.c
Changeset:
Modified: branches/SAMBA_3_0/source/include/smb.h
===================================================================
--- branches/SAMBA_3_0/source/include/smb.h 2007-04-07 05:49:24 UTC (rev 22122)
+++ branches/SAMBA_3_0/source/include/smb.h 2007-04-07 06:38:45 UTC (rev 22123)
@@ -1199,10 +1199,6 @@
#define SMB_SUPPORT_SEARCH_BITS 0x0001
#define SMB_SHARE_IN_DFS 0x0002
-/* Share specific rights. */
-#define SHARE_ALL_ACCESS 0x001F01FF
-#define SHARE_READ_ONLY 0x001200A9
-
/* Named pipe write mode flags. Used in writeX calls. */
#define PIPE_RAW_MODE 0x4
#define PIPE_START_MESSAGE 0x8
@@ -1246,17 +1242,24 @@
/* Mapping of generic access rights for files to specific rights. */
+/* This maps to 0x1F01FF */
#define FILE_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED_ACCESS| SYNCHRONIZE_ACCESS|FILE_ALL_ACCESS)
+/* This maps to 0x120089 */
#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ_ACCESS|FILE_READ_DATA|FILE_READ_ATTRIBUTES|\
FILE_READ_EA|SYNCHRONIZE_ACCESS)
+/* This maps to 0x120116 */
#define FILE_GENERIC_WRITE (STD_RIGHT_READ_CONTROL_ACCESS|FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|\
FILE_WRITE_EA|FILE_APPEND_DATA|SYNCHRONIZE_ACCESS)
#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE_ACCESS|\
FILE_EXECUTE|SYNCHRONIZE_ACCESS)
+/* Share specific rights. */
+#define SHARE_ALL_ACCESS FILE_GENERIC_ALL
+#define SHARE_READ_ONLY (FILE_GENERIC_READ|FILE_EXECUTE)
+
/* Mapping of access rights to UNIX perms. */
#define UNIX_ACCESS_RWX FILE_GENERIC_ALL
#define UNIX_ACCESS_R FILE_GENERIC_READ
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/nttrans.c 2007-04-07 05:49:24 UTC (rev 22122)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c 2007-04-07 06:38:45 UTC (rev 22123)
@@ -847,13 +847,12 @@
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 @@
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);
Modified: branches/SAMBA_3_0_25/source/include/smb.h
===================================================================
--- branches/SAMBA_3_0_25/source/include/smb.h 2007-04-07 05:49:24 UTC (rev 22122)
+++ branches/SAMBA_3_0_25/source/include/smb.h 2007-04-07 06:38:45 UTC (rev 22123)
@@ -1206,10 +1206,6 @@
#define SMB_SUPPORT_SEARCH_BITS 0x0001
#define SMB_SHARE_IN_DFS 0x0002
-/* Share specific rights. */
-#define SHARE_ALL_ACCESS 0x001F01FF
-#define SHARE_READ_ONLY 0x001200A9
-
/* Named pipe write mode flags. Used in writeX calls. */
#define PIPE_RAW_MODE 0x4
#define PIPE_START_MESSAGE 0x8
@@ -1253,17 +1249,24 @@
/* Mapping of generic access rights for files to specific rights. */
+/* This maps to 0x1F01FF */
#define FILE_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED_ACCESS| SYNCHRONIZE_ACCESS|FILE_ALL_ACCESS)
+/* This maps to 0x120089 */
#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ_ACCESS|FILE_READ_DATA|FILE_READ_ATTRIBUTES|\
FILE_READ_EA|SYNCHRONIZE_ACCESS)
+/* This maps to 0x120116 */
#define FILE_GENERIC_WRITE (STD_RIGHT_READ_CONTROL_ACCESS|FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|\
FILE_WRITE_EA|FILE_APPEND_DATA|SYNCHRONIZE_ACCESS)
#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE_ACCESS|\
FILE_EXECUTE|SYNCHRONIZE_ACCESS)
+/* Share specific rights. */
+#define SHARE_ALL_ACCESS FILE_GENERIC_ALL
+#define SHARE_READ_ONLY (FILE_GENERIC_READ|FILE_EXECUTE)
+
/* Mapping of access rights to UNIX perms. */
#define UNIX_ACCESS_RWX FILE_GENERIC_ALL
#define UNIX_ACCESS_R FILE_GENERIC_READ
Modified: branches/SAMBA_3_0_25/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/nttrans.c 2007-04-07 05:49:24 UTC (rev 22122)
+++ branches/SAMBA_3_0_25/source/smbd/nttrans.c 2007-04-07 06:38:45 UTC (rev 22123)
@@ -847,13 +847,12 @@
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 @@
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);
More information about the samba-cvs
mailing list