Skip to content

Commit

Permalink
smb: Use the correct error code for access denied on file open
Browse files Browse the repository at this point in the history
- 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 curl#4095
  • Loading branch information
juergenhoetzel authored and jay committed Jul 11, 2019
1 parent 0428852 commit ac3d19a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/smb.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit ac3d19a

Please sign in to comment.