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 6eea8d81e..de49b172d 100644
--- a/auth1.c
+++ b/auth1.c
@@ -385,7 +385,7 @@ void
385do_authentication(Authctxt *authctxt) 385do_authentication(Authctxt *authctxt)
386{ 386{
387 u_int ulen; 387 u_int ulen;
388 char *user, *style = NULL; 388 char *user, *style = NULL, *role = NULL;
389 389
390 /* Get the name of the user that we wish to log in as. */ 390 /* Get the name of the user that we wish to log in as. */
391 packet_read_expect(SSH_CMSG_USER); 391 packet_read_expect(SSH_CMSG_USER);
@@ -394,11 +394,17 @@ do_authentication(Authctxt *authctxt)
394 user = packet_get_cstring(&ulen); 394 user = packet_get_cstring(&ulen);
395 packet_check_eom(); 395 packet_check_eom();
396 396
397 if ((role = strchr(user, '/')) != NULL)
398 *role++ = '\0';
399
397 if ((style = strchr(user, ':')) != NULL) 400 if ((style = strchr(user, ':')) != NULL)
398 *style++ = '\0'; 401 *style++ = '\0';
402 else if (role && (style = strchr(role, ':')) != NULL)
403 *style++ = '\0';
399 404
400 authctxt->user = user; 405 authctxt->user = user;
401 authctxt->style = style; 406 authctxt->style = style;
407 authctxt->role = role;
402 408
403 /* Verify that the user is a valid user. */ 409 /* Verify that the user is a valid user. */
404 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 410 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)