summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/auth2.c b/auth2.c
index 54070e3a9..1f9ec6327 100644
--- a/auth2.c
+++ b/auth2.c
@@ -221,7 +221,7 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
221{ 221{
222 Authctxt *authctxt = ssh->authctxt; 222 Authctxt *authctxt = ssh->authctxt;
223 Authmethod *m = NULL; 223 Authmethod *m = NULL;
224 char *user, *service, *method, *style = NULL; 224 char *user, *service, *method, *style = NULL, *role = NULL;
225 int authenticated = 0; 225 int authenticated = 0;
226 226
227 if (authctxt == NULL) 227 if (authctxt == NULL)
@@ -233,8 +233,13 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
233 debug("userauth-request for user %s service %s method %s", user, service, method); 233 debug("userauth-request for user %s service %s method %s", user, service, method);
234 debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); 234 debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
235 235
236 if ((role = strchr(user, '/')) != NULL)
237 *role++ = 0;
238
236 if ((style = strchr(user, ':')) != NULL) 239 if ((style = strchr(user, ':')) != NULL)
237 *style++ = 0; 240 *style++ = 0;
241 else if (role && (style = strchr(role, ':')) != NULL)
242 *style++ = '\0';
238 243
239 if (authctxt->attempt++ == 0) { 244 if (authctxt->attempt++ == 0) {
240 /* setup auth context */ 245 /* setup auth context */
@@ -261,8 +266,9 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
261 use_privsep ? " [net]" : ""); 266 use_privsep ? " [net]" : "");
262 authctxt->service = xstrdup(service); 267 authctxt->service = xstrdup(service);
263 authctxt->style = style ? xstrdup(style) : NULL; 268 authctxt->style = style ? xstrdup(style) : NULL;
269 authctxt->role = role ? xstrdup(role) : NULL;
264 if (use_privsep) 270 if (use_privsep)
265 mm_inform_authserv(service, style); 271 mm_inform_authserv(service, style, role);
266 userauth_banner(); 272 userauth_banner();
267 if (auth2_setup_methods_lists(authctxt) != 0) 273 if (auth2_setup_methods_lists(authctxt) != 0)
268 packet_disconnect("no authentication methods enabled"); 274 packet_disconnect("no authentication methods enabled");