mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
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 commit is contained in:
parent
fe463bc568
commit
c70edc3fb8
@ -501,15 +501,18 @@ 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:
|
||||
if (req->smb_conn->config.nt_status_support &&
|
||||
req->smb_conn->negotiate.client_caps & CAP_STATUS32) {
|
||||
status = NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/*
|
||||
@ -530,15 +533,18 @@ 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:
|
||||
if (req->smb_conn->config.nt_status_support &&
|
||||
req->smb_conn->negotiate.client_caps & CAP_STATUS32) {
|
||||
status = NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user