1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

smb: Use the correct error code for access denied on file open

- Return CURLE_REMOTE_ACCESS_DENIED for SMB access denied on file open.

Prior to this change CURLE_REMOTE_FILE_NOT_FOUND was returned instead.

Closes https://github.com/curl/curl/pull/4095
This commit is contained in:
Juergen Hoetzel 2019-07-07 17:10:24 +02:00 committed by Jay Satiro
parent 0428852c2c
commit ac3d19a26d

View File

@ -785,6 +785,8 @@ static CURLcode smb_request_state(struct connectdata *conn, bool *done)
case SMB_OPEN:
if(h->status || smbc->got < sizeof(struct smb_nt_create_response)) {
req->result = CURLE_REMOTE_FILE_NOT_FOUND;
if(h->status == smb_swap32(SMB_ERR_NOACCESS))
req->result = CURLE_REMOTE_ACCESS_DENIED;
next_state = SMB_TREE_DISCONNECT;
break;
}