aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Hoetzel <juergen@archlinux.org>2019-07-07 17:10:24 +0200
committerJay Satiro <raysatiro@yahoo.com>2019-07-11 02:57:40 -0400
commitac3d19a26de79d9ec62d20a1a0b645d7ddcc40fd (patch)
tree9dc9b51d7a9802f677cc6b5ff02515bc0605c99b
parent0428852c2ccb01823bfdd0954f731d33f41276f5 (diff)
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
-rw-r--r--lib/smb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/smb.c b/lib/smb.c
index 5a4b7804d..870244cb7 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -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;
}