summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-27 18:06:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:05 -0500
commit9a067547ecf96878213f8e46eb5a41b372e4d0a2 (patch)
treed7a02e2f7dc202958b92b402442c89ba3d5ccb2f /source4
parent6d35c078114d911784bf7c18fc700ea81cea6f6f (diff)
downloadsamba-9a067547ecf96878213f8e46eb5a41b372e4d0a2.tar.gz
samba-9a067547ecf96878213f8e46eb5a41b372e4d0a2.tar.bz2
samba-9a067547ecf96878213f8e46eb5a41b372e4d0a2.zip
r17280: NT_STATUS_INVALID_HANDLE maps to ERRbadfid, which is wrong in this
places, so only overwrite ERRbaduid and ERRinvnid when NTSTATUS support is given. metze (This used to be commit c70edc3fb8ef02ce12c784fad7ee9d5ac782bf98)
Diffstat (limited to 'source4')
-rw-r--r--source4/smb_server/smb/receive.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c
index a47d0a5442..6fce5dc7c0 100644
--- a/source4/smb_server/smb/receive.c
+++ b/source4/smb_server/smb/receive.c
@@ -501,16 +501,19 @@ static void switch_message(int type, struct smbsrv_request *req)
/* see if the vuid is valid */
if ((flags & NEED_SESS) && !req->session) {
+ status = NT_STATUS_DOS(ERRSRV, ERRbaduid);
/* amazingly, the error code depends on the command */
switch (type) {
- case SMBntcreateX:
- case SMBntcancel:
- case SMBulogoffX:
- status = NT_STATUS_DOS(ERRSRV, ERRbaduid);
- break;
- default:
+ case SMBntcreateX:
+ case SMBntcancel:
+ case SMBulogoffX:
+ break;
+ default:
+ if (req->smb_conn->config.nt_status_support &&
+ req->smb_conn->negotiate.client_caps & CAP_STATUS32) {
status = NT_STATUS_INVALID_HANDLE;
- break;
+ }
+ break;
}
/*
* TODO:
@@ -530,16 +533,19 @@ static void switch_message(int type, struct smbsrv_request *req)
/* does this protocol need a valid tree connection? */
if ((flags & NEED_TCON) && !req->tcon) {
+ status = NT_STATUS_DOS(ERRSRV, ERRinvnid);
/* amazingly, the error code depends on the command */
switch (type) {
- case SMBntcreateX:
- case SMBntcancel:
- case SMBtdis:
- status = NT_STATUS_DOS(ERRSRV, ERRinvnid);
- break;
- default:
+ case SMBntcreateX:
+ case SMBntcancel:
+ case SMBtdis:
+ break;
+ default:
+ if (req->smb_conn->config.nt_status_support &&
+ req->smb_conn->negotiate.client_caps & CAP_STATUS32) {
status = NT_STATUS_INVALID_HANDLE;
- break;
+ }
+ break;
}
/*
* TODO: