diff options
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -267,7 +267,7 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) | |||
267 | { | 267 | { |
268 | Authctxt *authctxt = ssh->authctxt; | 268 | Authctxt *authctxt = ssh->authctxt; |
269 | Authmethod *m = NULL; | 269 | Authmethod *m = NULL; |
270 | char *user = NULL, *service = NULL, *method = NULL, *style = NULL; | 270 | char *user = NULL, *service = NULL, *method = NULL, *style = NULL, *role = NULL; |
271 | int r, authenticated = 0; | 271 | int r, authenticated = 0; |
272 | double tstart = monotime_double(); | 272 | double tstart = monotime_double(); |
273 | 273 | ||
@@ -281,8 +281,13 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) | |||
281 | debug("userauth-request for user %s service %s method %s", user, service, method); | 281 | debug("userauth-request for user %s service %s method %s", user, service, method); |
282 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); | 282 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); |
283 | 283 | ||
284 | if ((role = strchr(user, '/')) != NULL) | ||
285 | *role++ = 0; | ||
286 | |||
284 | if ((style = strchr(user, ':')) != NULL) | 287 | if ((style = strchr(user, ':')) != NULL) |
285 | *style++ = 0; | 288 | *style++ = 0; |
289 | else if (role && (style = strchr(role, ':')) != NULL) | ||
290 | *style++ = '\0'; | ||
286 | 291 | ||
287 | if (authctxt->attempt++ == 0) { | 292 | if (authctxt->attempt++ == 0) { |
288 | /* setup auth context */ | 293 | /* setup auth context */ |
@@ -309,8 +314,9 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) | |||
309 | use_privsep ? " [net]" : ""); | 314 | use_privsep ? " [net]" : ""); |
310 | authctxt->service = xstrdup(service); | 315 | authctxt->service = xstrdup(service); |
311 | authctxt->style = style ? xstrdup(style) : NULL; | 316 | authctxt->style = style ? xstrdup(style) : NULL; |
317 | authctxt->role = role ? xstrdup(role) : NULL; | ||
312 | if (use_privsep) | 318 | if (use_privsep) |
313 | mm_inform_authserv(service, style); | 319 | mm_inform_authserv(service, style, role); |
314 | userauth_banner(ssh); | 320 | userauth_banner(ssh); |
315 | if (auth2_setup_methods_lists(authctxt) != 0) | 321 | if (auth2_setup_methods_lists(authctxt) != 0) |
316 | ssh_packet_disconnect(ssh, | 322 | ssh_packet_disconnect(ssh, |