diff options
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -217,7 +217,7 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
217 | struct ssh *ssh = active_state; /* XXX */ | 217 | struct ssh *ssh = active_state; /* XXX */ |
218 | Authctxt *authctxt = ctxt; | 218 | Authctxt *authctxt = ctxt; |
219 | Authmethod *m = NULL; | 219 | Authmethod *m = NULL; |
220 | char *user, *service, *method, *style = NULL; | 220 | char *user, *service, *method, *style = NULL, *role = NULL; |
221 | int authenticated = 0; | 221 | int authenticated = 0; |
222 | 222 | ||
223 | if (authctxt == NULL) | 223 | if (authctxt == NULL) |
@@ -229,8 +229,13 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
229 | debug("userauth-request for user %s service %s method %s", user, service, method); | 229 | debug("userauth-request for user %s service %s method %s", user, service, method); |
230 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); | 230 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); |
231 | 231 | ||
232 | if ((role = strchr(user, '/')) != NULL) | ||
233 | *role++ = 0; | ||
234 | |||
232 | if ((style = strchr(user, ':')) != NULL) | 235 | if ((style = strchr(user, ':')) != NULL) |
233 | *style++ = 0; | 236 | *style++ = 0; |
237 | else if (role && (style = strchr(role, ':')) != NULL) | ||
238 | *style++ = '\0'; | ||
234 | 239 | ||
235 | if (authctxt->attempt++ == 0) { | 240 | if (authctxt->attempt++ == 0) { |
236 | /* setup auth context */ | 241 | /* setup auth context */ |
@@ -257,8 +262,9 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
257 | use_privsep ? " [net]" : ""); | 262 | use_privsep ? " [net]" : ""); |
258 | authctxt->service = xstrdup(service); | 263 | authctxt->service = xstrdup(service); |
259 | authctxt->style = style ? xstrdup(style) : NULL; | 264 | authctxt->style = style ? xstrdup(style) : NULL; |
265 | authctxt->role = role ? xstrdup(role) : NULL; | ||
260 | if (use_privsep) | 266 | if (use_privsep) |
261 | mm_inform_authserv(service, style); | 267 | mm_inform_authserv(service, style, role); |
262 | userauth_banner(); | 268 | userauth_banner(); |
263 | if (auth2_setup_methods_lists(authctxt) != 0) | 269 | if (auth2_setup_methods_lists(authctxt) != 0) |
264 | packet_disconnect("no authentication methods enabled"); | 270 | packet_disconnect("no authentication methods enabled"); |