File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1431,7 +1431,7 @@ static int ntlm_authenticate(struct ksmbd_work *work)
14311431 * Reuse session if anonymous try to connect
14321432 * on reauthetication.
14331433 */
1434- if (ksmbd_anonymous_user (user )) {
1434+ if (conn -> binding == false && ksmbd_anonymous_user (user )) {
14351435 ksmbd_free_user (user );
14361436 return 0 ;
14371437 }
@@ -1445,7 +1445,7 @@ static int ntlm_authenticate(struct ksmbd_work *work)
14451445 sess -> user = user ;
14461446 }
14471447
1448- if (user_guest (sess -> user )) {
1448+ if (conn -> binding == false && user_guest (sess -> user )) {
14491449 rsp -> SessionFlags = SMB2_SESSION_FLAG_IS_GUEST_LE ;
14501450 } else {
14511451 struct authenticate_message * authblob ;
@@ -1687,6 +1687,11 @@ int smb2_sess_setup(struct ksmbd_work *work)
16871687 goto out_err ;
16881688 }
16891689
1690+ if (user_guest (sess -> user )) {
1691+ rc = - EOPNOTSUPP ;
1692+ goto out_err ;
1693+ }
1694+
16901695 conn -> binding = true;
16911696 } else if ((conn -> dialect < SMB30_PROT_ID ||
16921697 server_conf .flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL ) &&
@@ -1811,6 +1816,8 @@ int smb2_sess_setup(struct ksmbd_work *work)
18111816 rsp -> hdr .Status = STATUS_NETWORK_SESSION_EXPIRED ;
18121817 else if (rc == - ENOMEM )
18131818 rsp -> hdr .Status = STATUS_INSUFFICIENT_RESOURCES ;
1819+ else if (rc == - EOPNOTSUPP )
1820+ rsp -> hdr .Status = STATUS_NOT_SUPPORTED ;
18141821 else if (rc )
18151822 rsp -> hdr .Status = STATUS_LOGON_FAILURE ;
18161823
You can’t perform that action at this time.
0 commit comments