diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2022-08-08 15:56:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-05 11:31:32 +0300 |
commit | 40f424dc1ee328832ec86df29b8939e2e1618153 (patch) | |
tree | ef9e54347bea25f1a342cbb8b21e61afee8ec968 /fs | |
parent | 4b25bdb54578f3b96ff055e5d27bc1cb82950e51 (diff) | |
download | linux-40f424dc1ee328832ec86df29b8939e2e1618153.tar.xz |
ksmbd: return STATUS_BAD_NETWORK_NAME error status if share is not configured
[ Upstream commit fe54833dc8d97ef387e86f7c80537d51c503ca75 ]
If share is not configured in smb.conf, smb2 tree connect should return
STATUS_BAD_NETWORK_NAME instead of STATUS_BAD_NETWORK_PATH.
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ksmbd/mgmt/tree_connect.c | 2 | ||||
-rw-r--r-- | fs/ksmbd/smb2pdu.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/ksmbd/mgmt/tree_connect.c b/fs/ksmbd/mgmt/tree_connect.c index 0d28e723a28c..940385c6a913 100644 --- a/fs/ksmbd/mgmt/tree_connect.c +++ b/fs/ksmbd/mgmt/tree_connect.c @@ -18,7 +18,7 @@ struct ksmbd_tree_conn_status ksmbd_tree_conn_connect(struct ksmbd_session *sess, char *share_name) { - struct ksmbd_tree_conn_status status = {-EINVAL, NULL}; + struct ksmbd_tree_conn_status status = {-ENOENT, NULL}; struct ksmbd_tree_connect_response *resp = NULL; struct ksmbd_share_config *sc; struct ksmbd_tree_connect *tree_conn = NULL; diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index a9c33d15ca1f..bbb3958b6469 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -1930,8 +1930,9 @@ out_err1: rsp->hdr.Status = STATUS_SUCCESS; rc = 0; break; + case -ENOENT: case KSMBD_TREE_CONN_STATUS_NO_SHARE: - rsp->hdr.Status = STATUS_BAD_NETWORK_PATH; + rsp->hdr.Status = STATUS_BAD_NETWORK_NAME; break; case -ENOMEM: case KSMBD_TREE_CONN_STATUS_NOMEM: |