summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2014-02-09 16:09:49 +0000
committerColin Watson <cjwatson@debian.org>2017-10-04 13:54:48 +0100
commit4b276122c04aed0726803a92c8ca955e614a4d3a (patch)
tree5c5638fad9f6edf9ada6a4661f6c5cbb1bec2696 /monitor_wrap.c
parentcdd9076a145a95c21538eedb3f728a897480c5de (diff)
Handle SELinux authorisation roles
Rejected upstream due to discomfort with magic usernames; a better approach will need an SSH protocol change. In the meantime, this came from Debian's SELinux maintainer, so we'll keep it until we have something better. Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1641 Bug-Debian: http://bugs.debian.org/394795 Last-Update: 2017-10-04 Patch-Name: selinux-role.patch
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 0e171a6a6..d806bb2e7 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -336,10 +336,10 @@ mm_auth2_read_banner(void)
336 return (banner); 336 return (banner);
337} 337}
338 338
339/* Inform the privileged process about service and style */ 339/* Inform the privileged process about service, style, and role */
340 340
341void 341void
342mm_inform_authserv(char *service, char *style) 342mm_inform_authserv(char *service, char *style, char *role)
343{ 343{
344 Buffer m; 344 Buffer m;
345 345
@@ -348,12 +348,30 @@ mm_inform_authserv(char *service, char *style)
348 buffer_init(&m); 348 buffer_init(&m);
349 buffer_put_cstring(&m, service); 349 buffer_put_cstring(&m, service);
350 buffer_put_cstring(&m, style ? style : ""); 350 buffer_put_cstring(&m, style ? style : "");
351 buffer_put_cstring(&m, role ? role : "");
351 352
352 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); 353 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
353 354
354 buffer_free(&m); 355 buffer_free(&m);
355} 356}
356 357
358/* Inform the privileged process about role */
359
360void
361mm_inform_authrole(char *role)
362{
363 Buffer m;
364
365 debug3("%s entering", __func__);
366
367 buffer_init(&m);
368 buffer_put_cstring(&m, role ? role : "");
369
370 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m);
371
372 buffer_free(&m);
373}
374
357/* Do the password authentication */ 375/* Do the password authentication */
358int 376int
359mm_auth_password(Authctxt *authctxt, char *password) 377mm_auth_password(Authctxt *authctxt, char *password)