Skip to content

Commit

Permalink
ksmbd: return STATUS_BAD_NETWORK_NAME error status if share is not co…
Browse files Browse the repository at this point in the history
…nfigured

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 <[email protected]>
Reviewed-by: Hyunchul Lee <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
namjaejeon authored and Steve French committed Aug 11, 2022
1 parent eb555cb commit fe54833
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/ksmbd/mgmt/tree_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct ksmbd_tree_conn_status
ksmbd_tree_conn_connect(struct ksmbd_conn *conn, 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;
Expand Down
3 changes: 2 additions & 1 deletion fs/ksmbd/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,8 +1944,9 @@ int smb2_tree_connect(struct ksmbd_work *work)
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:
Expand Down

0 comments on commit fe54833

Please sign in to comment.