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>2016-08-07 12:18:42 +0100
commit7a7851c903e5dbb58a85014deb2c88cb718068c9 (patch)
tree3c558bbeaf0e964e6b9c55128f0f8007113c47ef /monitor_wrap.c
parentc027de5eb3e6cb1718990841c2a9cbc89fd53151 (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: 2015-08-19 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 5a9f1b52d..11e3a6956 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -328,10 +328,10 @@ mm_auth2_read_banner(void)
328 return (banner); 328 return (banner);
329} 329}
330 330
331/* Inform the privileged process about service and style */ 331/* Inform the privileged process about service, style, and role */
332 332
333void 333void
334mm_inform_authserv(char *service, char *style) 334mm_inform_authserv(char *service, char *style, char *role)
335{ 335{
336 Buffer m; 336 Buffer m;
337 337
@@ -340,12 +340,30 @@ mm_inform_authserv(char *service, char *style)
340 buffer_init(&m); 340 buffer_init(&m);
341 buffer_put_cstring(&m, service); 341 buffer_put_cstring(&m, service);
342 buffer_put_cstring(&m, style ? style : ""); 342 buffer_put_cstring(&m, style ? style : "");
343 buffer_put_cstring(&m, role ? role : "");
343 344
344 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); 345 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
345 346
346 buffer_free(&m); 347 buffer_free(&m);
347} 348}
348 349
350/* Inform the privileged process about role */
351
352void
353mm_inform_authrole(char *role)
354{
355 Buffer m;
356
357 debug3("%s entering", __func__);
358
359 buffer_init(&m);
360 buffer_put_cstring(&m, role ? role : "");
361
362 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m);
363
364 buffer_free(&m);
365}
366
349/* Do the password authentication */ 367/* Do the password authentication */
350int 368int
351mm_auth_password(Authctxt *authctxt, char *password) 369mm_auth_password(Authctxt *authctxt, char *password)