diff options
author | Jeremy Allison <jra@samba.org> | 2002-02-27 21:46:53 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-02-27 21:46:53 +0000 |
commit | 2da4d64cfcf289d18d622c67d3250c51e6b88466 (patch) | |
tree | e6e8897eff144ae4f8cc6a79b94760a737d2e1bb /source3/smbd | |
parent | 9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed (diff) | |
download | samba-2da4d64cfcf289d18d622c67d3250c51e6b88466.tar.gz samba-2da4d64cfcf289d18d622c67d3250c51e6b88466.tar.bz2 samba-2da4d64cfcf289d18d622c67d3250c51e6b88466.zip |
Added "nt status support" parameter. Fix offline synchronisation.
Jeremy.
(This used to be commit 9243a9778e52999d5c62cba484640637b24994d8)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/error.c | 16 | ||||
-rw-r--r-- | source3/smbd/negprot.c | 25 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 9 | ||||
-rw-r--r-- | source3/smbd/reply.c | 10 |
4 files changed, 32 insertions, 28 deletions
diff --git a/source3/smbd/error.c b/source3/smbd/error.c index 6b3b73aa87..92a7c11b15 100644 --- a/source3/smbd/error.c +++ b/source3/smbd/error.c @@ -90,10 +90,17 @@ int error_packet(char *outbuf,NTSTATUS ntstatus, if (errno != 0) DEBUG(3,("error string = %s\n",strerror(errno))); - if (global_client_caps & CAP_STATUS32) { - if (NT_STATUS_V(ntstatus) == 0 && eclass) { + /* + * We can explicitly force 32 bit error codes even when the + * parameter "nt status" is set to no by pre-setting the + * FLAGS2_32_BIT_ERROR_CODES bit in the smb_flg2 outbuf. + * This is to allow work arounds for client bugs that are needed + * when talking with clients that normally expect nt status codes. JRA. + */ + + if ((lp_nt_status_support() || (SVAL(outbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) && (global_client_caps & CAP_STATUS32)) { + if (NT_STATUS_V(ntstatus) == 0 && eclass) ntstatus = dos_to_ntstatus(eclass, ecode); - } SIVAL(outbuf,smb_rcls,NT_STATUS_V(ntstatus)); SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES); DEBUG(3,("error packet at %s(%d) cmd=%d (%s) %s\n", @@ -104,9 +111,8 @@ int error_packet(char *outbuf,NTSTATUS ntstatus, return outsize; } - if (eclass == 0 && NT_STATUS_V(ntstatus)) { + if (eclass == 0 && NT_STATUS_V(ntstatus)) ntstatus_to_dos(ntstatus, &eclass, &ecode); - } SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)&~FLAGS2_32_BIT_ERROR_CODES); SSVAL(outbuf,smb_rcls,eclass); diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 934d594853..f4ed360845 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -220,7 +220,7 @@ static int reply_nt1(char *inbuf, char *outbuf) { /* dual names + lock_and_read + nt SMBs + remote API calls */ int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ| - CAP_LEVEL_II_OPLOCKS|CAP_STATUS32; + CAP_LEVEL_II_OPLOCKS; int secword=0; time_t t = time(NULL); @@ -242,28 +242,29 @@ static int reply_nt1(char *inbuf, char *outbuf) capabilities |= CAP_NT_SMBS|CAP_RPC_REMOTE_APIS|CAP_UNIX; - if (lp_large_readwrite() && (SMB_OFF_T_BITS == 64)) { + if (lp_large_readwrite() && (SMB_OFF_T_BITS == 64)) capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX|CAP_W2K_SMBS; - } - if (SMB_OFF_T_BITS == 64) { + if (SMB_OFF_T_BITS == 64) capabilities |= CAP_LARGE_FILES; - } - - if (lp_readraw() && lp_writeraw()) { + + if (lp_readraw() && lp_writeraw()) capabilities |= CAP_RAW_MODE; - } /* allow for disabling unicode */ - if (lp_unicode()) { + if (lp_unicode()) capabilities |= CAP_UNICODE; - } + + if (lp_nt_status_support()) + capabilities |= CAP_STATUS32; if (lp_host_msdfs()) capabilities |= CAP_DFS; - if (lp_security() >= SEC_USER) secword |= 1; - if (global_encrypted_passwords_negotiated) secword |= 2; + if (lp_security() >= SEC_USER) + secword |= 1; + if (global_encrypted_passwords_negotiated) + secword |= 2; set_message(outbuf,17,0,True); diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 501f0e9ab0..d56b7fe622 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -828,8 +828,8 @@ int reply_ntcreate_and_X(connection_struct *conn, if(oplock_request && EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) smb_action |= EXTENDED_OPLOCK_GRANTED; -#if 1 /* JRATEST */ - /* W2K sends back 42 words here ! */ +#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); @@ -1809,9 +1809,8 @@ due to being in oplock break state.\n" )); } } - if (Protocol >= PROTOCOL_NT1) { - SSVAL(outbuf,smb_flg2,SVAL(outbuf,smb_flg2) | 0x40); /* IS_LONG_NAME */ - } + if (Protocol >= PROTOCOL_NT1) + SSVAL(outbuf,smb_flg2,SVAL(outbuf,smb_flg2) | FLAGS2_IS_LONG_NAME); /* Now we must call the relevant NT_TRANS function */ switch(function_code) { diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index c7f805122d..0a349a9c8a 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -482,9 +482,8 @@ int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size put_dos_date3(outbuf,smb_vwv1,mtime); SIVAL(outbuf,smb_vwv3,(uint32)size); - if (Protocol >= PROTOCOL_NT1) { - SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | 0x40); /* IS_LONG_NAME */ - } + if (Protocol >= PROTOCOL_NT1) + SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME); DEBUG( 3, ( "getatr name=%s mode=%d size=%d\n", fname, mode, (uint32)size ) ); @@ -760,9 +759,8 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size SCVAL(smb_buf(outbuf),0,5); SSVAL(smb_buf(outbuf),1,numentries*DIR_STRUCT_SIZE); - if (Protocol >= PROTOCOL_NT1) { - SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | 0x40); /* IS_LONG_NAME */ - } + if (Protocol >= PROTOCOL_NT1) + SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME); outsize += DIR_STRUCT_SIZE*numentries; smb_setlen(outbuf,outsize - 4); |