diff options
Diffstat (limited to 'auth1.c')
-rw-r--r-- | auth1.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -381,7 +381,7 @@ void | |||
381 | do_authentication(Authctxt *authctxt) | 381 | do_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) |