summaryrefslogtreecommitdiff
path: root/auth1.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/auth1.c b/auth1.c
index b9d6b1115..ac8f6414b 100644
--- a/auth1.c
+++ b/auth1.c
@@ -388,7 +388,7 @@ void
388do_authentication(Authctxt *authctxt) 388do_authentication(Authctxt *authctxt)
389{ 389{
390 u_int ulen; 390 u_int ulen;
391 char *user, *style = NULL; 391 char *user, *style = NULL, *role = NULL;
392 392
393 /* Get the name of the user that we wish to log in as. */ 393 /* Get the name of the user that we wish to log in as. */
394 packet_read_expect(SSH_CMSG_USER); 394 packet_read_expect(SSH_CMSG_USER);
@@ -397,11 +397,17 @@ do_authentication(Authctxt *authctxt)
397 user = packet_get_string(&ulen); 397 user = packet_get_string(&ulen);
398 packet_check_eom(); 398 packet_check_eom();
399 399
400 if ((role = strchr(user, '/')) != NULL)
401 *role++ = '\0';
402
400 if ((style = strchr(user, ':')) != NULL) 403 if ((style = strchr(user, ':')) != NULL)
401 *style++ = '\0'; 404 *style++ = '\0';
405 else if (role && (style = strchr(role, ':')) != NULL)
406 *style++ = '\0';
402 407
403 authctxt->user = user; 408 authctxt->user = user;
404 authctxt->style = style; 409 authctxt->style = style;
410 authctxt->role = role;
405 411
406 /* Verify that the user is a valid user. */ 412 /* Verify that the user is a valid user. */
407 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 413 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)