diff options
Diffstat (limited to 'auth1.c')
-rw-r--r-- | auth1.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -370,7 +370,7 @@ void | |||
370 | do_authentication(Authctxt *authctxt) | 370 | do_authentication(Authctxt *authctxt) |
371 | { | 371 | { |
372 | u_int ulen; | 372 | u_int ulen; |
373 | char *user, *style = NULL; | 373 | char *user, *style = NULL, *role = NULL; |
374 | 374 | ||
375 | /* Get the name of the user that we wish to log in as. */ | 375 | /* Get the name of the user that we wish to log in as. */ |
376 | packet_read_expect(SSH_CMSG_USER); | 376 | packet_read_expect(SSH_CMSG_USER); |
@@ -379,11 +379,17 @@ do_authentication(Authctxt *authctxt) | |||
379 | user = packet_get_string(&ulen); | 379 | user = packet_get_string(&ulen); |
380 | packet_check_eom(); | 380 | packet_check_eom(); |
381 | 381 | ||
382 | if ((role = strchr(user, '/')) != NULL) | ||
383 | *role++ = '\0'; | ||
384 | |||
382 | if ((style = strchr(user, ':')) != NULL) | 385 | if ((style = strchr(user, ':')) != NULL) |
383 | *style++ = '\0'; | 386 | *style++ = '\0'; |
387 | else if (role && (style = strchr(role, ':')) != NULL) | ||
388 | *style++ = '\0'; | ||
384 | 389 | ||
385 | authctxt->user = user; | 390 | authctxt->user = user; |
386 | authctxt->style = style; | 391 | authctxt->style = style; |
392 | authctxt->role = role; | ||
387 | 393 | ||
388 | /* Verify that the user is a valid user. */ | 394 | /* Verify that the user is a valid user. */ |
389 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) | 395 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) |