diff options
author | Jeremy Allison <jra@samba.org> | 2002-04-30 13:28:41 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-04-30 13:28:41 +0000 |
commit | d04b55f2186fb8af998cf61c576771a5f72f4892 (patch) | |
tree | 9ff8c3a7cf34cefc0ee9a550a3bb1236a9e77595 /source/smbd/error.c | |
parent | 73267ca42d9eddabb71b31b4c5068ebbe7bc9f7c (diff) | |
download | samba-d04b55f2186fb8af998cf61c576771a5f72f4892.tar.gz samba-d04b55f2186fb8af998cf61c576771a5f72f4892.tar.xz samba-d04b55f2186fb8af998cf61c576771a5f72f4892.zip |
Start of merge to 2_2_RELEASE branch for release.
Jeremy.
Diffstat (limited to 'source/smbd/error.c')
-rw-r--r-- | source/smbd/error.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/smbd/error.c b/source/smbd/error.c index 0a63d520ee6..6de16f1d5b9 100644 --- a/source/smbd/error.c +++ b/source/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); |