summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-12-01 02:25:53 +0000
committerJeremy Allison <jra@samba.org>2003-12-01 02:25:53 +0000
commitdd1ac8d5eba060dcd7fdde7449d07bee1dc12b27 (patch)
tree22f723e4669d8a74adde556679aadbc26605f75d /source
parentc662e2dbc4d953b3718f69fef4517a3e7539151e (diff)
downloadsamba-dd1ac8d5eba060dcd7fdde7449d07bee1dc12b27.tar.gz
samba-dd1ac8d5eba060dcd7fdde7449d07bee1dc12b27.tar.xz
samba-dd1ac8d5eba060dcd7fdde7449d07bee1dc12b27.zip
Don't automatically set nt status code flag unless client tells us it can
cope. Jeremy.
Diffstat (limited to 'source')
-rw-r--r--source/smbd/process.c15
-rw-r--r--source/smbd/sesssetup.c28
2 files changed, 29 insertions, 14 deletions
diff --git a/source/smbd/process.c b/source/smbd/process.c
index 8a90a15d297..d93826bc7e2 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -924,11 +924,17 @@ const char *smb_fn_name(int type)
return(smb_messages[type].name);
}
-
/****************************************************************************
- Helper function for contruct_reply.
+ Helper functions for contruct_reply.
****************************************************************************/
+static uint32 common_flags2 = FLAGS2_LONG_PATH_COMPONENTS|FLAGS2_EXTENDED_SECURITY;
+
+void add_to_common_flags2(uint32 v)
+{
+ common_flags2 |= v;
+}
+
void construct_reply_common(char *inbuf,char *outbuf)
{
memset(outbuf,'\0',smb_size);
@@ -941,9 +947,8 @@ void construct_reply_common(char *inbuf,char *outbuf)
SCVAL(outbuf,smb_reh,0);
SCVAL(outbuf,smb_flg, FLAG_REPLY | (CVAL(inbuf,smb_flg) & FLAG_CASELESS_PATHNAMES));
SSVAL(outbuf,smb_flg2,
- (SVAL(inbuf,smb_flg2) & FLAGS2_UNICODE_STRINGS) |
- FLAGS2_LONG_PATH_COMPONENTS |
- FLAGS2_32_BIT_ERROR_CODES | FLAGS2_EXTENDED_SECURITY);
+ (SVAL(inbuf,smb_flg2) & FLAGS2_UNICODE_STRINGS) |
+ common_flags2);
SSVAL(outbuf,smb_err,SMB_SUCCESS);
SSVAL(outbuf,smb_tid,SVAL(inbuf,smb_tid));
diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c
index 64c25db2ab0..fb0744bb730 100644
--- a/source/smbd/sesssetup.c
+++ b/source/smbd/sesssetup.c
@@ -472,6 +472,11 @@ static int reply_sesssetup_and_X_spnego(connection_struct *conn, char *inbuf,
if (global_client_caps == 0) {
global_client_caps = IVAL(inbuf,smb_vwv10);
+
+ if (global_client_caps & CAP_STATUS32) {
+ add_to_common_flags2(FLAGS2_32_BIT_ERROR_CODES);
+ }
+
}
p = (uint8 *)smb_buf(inbuf);
@@ -615,17 +620,22 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
enum remote_arch_types ra_type = get_remote_arch();
char *p = smb_buf(inbuf);
- if(global_client_caps == 0)
+ if(global_client_caps == 0) {
global_client_caps = IVAL(inbuf,smb_vwv11);
- /* client_caps is used as final determination if client is NT or Win95.
- This is needed to return the correct error codes in some
- circumstances.
- */
+ if (global_client_caps & CAP_STATUS32) {
+ add_to_common_flags2(FLAGS2_32_BIT_ERROR_CODES);
+ }
+
+ /* client_caps is used as final determination if client is NT or Win95.
+ This is needed to return the correct error codes in some
+ circumstances.
+ */
- if(ra_type == RA_WINNT || ra_type == RA_WIN2K || ra_type == RA_WIN95) {
- if(!(global_client_caps & (CAP_NT_SMBS | CAP_STATUS32))) {
- set_remote_arch( RA_WIN95);
+ if(ra_type == RA_WINNT || ra_type == RA_WIN2K || ra_type == RA_WIN95) {
+ if(!(global_client_caps & (CAP_NT_SMBS | CAP_STATUS32))) {
+ set_remote_arch( RA_WIN95);
+ }
}
}
@@ -686,7 +696,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
ra_lanman_string( native_lanman );
}
-
+
if (SVAL(inbuf,smb_vwv4) == 0) {
setup_new_vc_session();
}