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