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 d08928455..4fe00ddae 100644
--- a/auth1.c
+++ b/auth1.c
@@ -308,7 +308,7 @@ void
308do_authentication(Authctxt *authctxt) 308do_authentication(Authctxt *authctxt)
309{ 309{
310 u_int ulen; 310 u_int ulen;
311 char *user, *style = NULL; 311 char *user, *style = NULL, *role = NULL;
312 312
313 /* Get the name of the user that we wish to log in as. */ 313 /* Get the name of the user that we wish to log in as. */
314 packet_read_expect(SSH_CMSG_USER); 314 packet_read_expect(SSH_CMSG_USER);
@@ -317,11 +317,17 @@ do_authentication(Authctxt *authctxt)
317 user = packet_get_string(&ulen); 317 user = packet_get_string(&ulen);
318 packet_check_eom(); 318 packet_check_eom();
319 319
320 if ((role = strchr(user, '/')) != NULL)
321 *role++ = '\0';
322
320 if ((style = strchr(user, ':')) != NULL) 323 if ((style = strchr(user, ':')) != NULL)
321 *style++ = '\0'; 324 *style++ = '\0';
325 else if (role && (style = strchr(role, ':')) != NULL)
326 *style++ = '\0';
322 327
323 authctxt->user = user; 328 authctxt->user = user;
324 authctxt->style = style; 329 authctxt->style = style;
330 authctxt->role = role;
325 331
326 /* Verify that the user is a valid user. */ 332 /* Verify that the user is a valid user. */
327 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 333 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)