diff options
Diffstat (limited to 'auth1.c')
-rw-r--r-- | auth1.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -380,7 +380,7 @@ void | |||
380 | do_authentication(Authctxt *authctxt) | 380 | do_authentication(Authctxt *authctxt) |
381 | { | 381 | { |
382 | u_int ulen; | 382 | u_int ulen; |
383 | char *user, *style = NULL; | 383 | char *user, *style = NULL, *role = NULL; |
384 | 384 | ||
385 | /* Get the name of the user that we wish to log in as. */ | 385 | /* Get the name of the user that we wish to log in as. */ |
386 | packet_read_expect(SSH_CMSG_USER); | 386 | packet_read_expect(SSH_CMSG_USER); |
@@ -389,11 +389,17 @@ do_authentication(Authctxt *authctxt) | |||
389 | user = packet_get_cstring(&ulen); | 389 | user = packet_get_cstring(&ulen); |
390 | packet_check_eom(); | 390 | packet_check_eom(); |
391 | 391 | ||
392 | if ((role = strchr(user, '/')) != NULL) | ||
393 | *role++ = '\0'; | ||
394 | |||
392 | if ((style = strchr(user, ':')) != NULL) | 395 | if ((style = strchr(user, ':')) != NULL) |
393 | *style++ = '\0'; | 396 | *style++ = '\0'; |
397 | else if (role && (style = strchr(role, ':')) != NULL) | ||
398 | *style++ = '\0'; | ||
394 | 399 | ||
395 | authctxt->user = user; | 400 | authctxt->user = user; |
396 | authctxt->style = style; | 401 | authctxt->style = style; |
402 | authctxt->role = role; | ||
397 | 403 | ||
398 | /* Verify that the user is a valid user. */ | 404 | /* Verify that the user is a valid user. */ |
399 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) | 405 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) |