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