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 b8a255872..8ff98d493 100644
--- a/auth1.c
+++ b/auth1.c
@@ -391,7 +391,7 @@ void
391do_authentication(Authctxt *authctxt) 391do_authentication(Authctxt *authctxt)
392{ 392{
393 u_int ulen; 393 u_int ulen;
394 char *user, *style = NULL; 394 char *user, *style = NULL, *role = NULL;
395 395
396 /* Get the name of the user that we wish to log in as. */ 396 /* Get the name of the user that we wish to log in as. */
397 packet_read_expect(SSH_CMSG_USER); 397 packet_read_expect(SSH_CMSG_USER);
@@ -400,11 +400,17 @@ do_authentication(Authctxt *authctxt)
400 user = packet_get_string(&ulen); 400 user = packet_get_string(&ulen);
401 packet_check_eom(); 401 packet_check_eom();
402 402
403 if ((role = strchr(user, '/')) != NULL)
404 *role++ = '\0';
405
403 if ((style = strchr(user, ':')) != NULL) 406 if ((style = strchr(user, ':')) != NULL)
404 *style++ = '\0'; 407 *style++ = '\0';
408 else if (role && (style = strchr(role, ':')) != NULL)
409 *style++ = '\0';
405 410
406 authctxt->user = user; 411 authctxt->user = user;
407 authctxt->style = style; 412 authctxt->style = style;
413 authctxt->role = role;
408 414
409 /* Verify that the user is a valid user. */ 415 /* Verify that the user is a valid user. */
410 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 416 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)