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 c34f58c45..be5e9f15f 100644
--- a/auth2.c
+++ b/auth2.c
@@ -218,7 +218,7 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
218{ 218{
219 Authctxt *authctxt = ssh->authctxt; 219 Authctxt *authctxt = ssh->authctxt;
220 Authmethod *m = NULL; 220 Authmethod *m = NULL;
221 char *user, *service, *method, *style = NULL; 221 char *user, *service, *method, *style = NULL, *role = NULL;
222 int authenticated = 0; 222 int authenticated = 0;
223 223
224 if (authctxt == NULL) 224 if (authctxt == NULL)
@@ -230,8 +230,13 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
230 debug("userauth-request for user %s service %s method %s", user, service, method); 230 debug("userauth-request for user %s service %s method %s", user, service, method);
231 debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); 231 debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
232 232
233 if ((role = strchr(user, '/')) != NULL)
234 *role++ = 0;
235
233 if ((style = strchr(user, ':')) != NULL) 236 if ((style = strchr(user, ':')) != NULL)
234 *style++ = 0; 237 *style++ = 0;
238 else if (role && (style = strchr(role, ':')) != NULL)
239 *style++ = '\0';
235 240
236 if (authctxt->attempt++ == 0) { 241 if (authctxt->attempt++ == 0) {
237 /* setup auth context */ 242 /* setup auth context */
@@ -258,8 +263,9 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
258 use_privsep ? " [net]" : ""); 263 use_privsep ? " [net]" : "");
259 authctxt->service = xstrdup(service); 264 authctxt->service = xstrdup(service);
260 authctxt->style = style ? xstrdup(style) : NULL; 265 authctxt->style = style ? xstrdup(style) : NULL;
266 authctxt->role = role ? xstrdup(role) : NULL;
261 if (use_privsep) 267 if (use_privsep)
262 mm_inform_authserv(service, style); 268 mm_inform_authserv(service, style, role);
263 userauth_banner(); 269 userauth_banner();
264 if (auth2_setup_methods_lists(authctxt) != 0) 270 if (auth2_setup_methods_lists(authctxt) != 0)
265 packet_disconnect("no authentication methods enabled"); 271 packet_disconnect("no authentication methods enabled");