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>2018-04-03 08:20:56 +0100
commit7da968d97beba5fb80a5488516563ea1376db907 (patch)
tree0e9107c92138281814181acbdd1428a6862ef63b /monitor_wrap.c
parent398af3d66bfe8dc7d436570026571e522a0a13a0 (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 e749efc18..7b2d06c65 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -331,10 +331,10 @@ mm_auth2_read_banner(void)
331 return (banner); 331 return (banner);
332} 332}
333 333
334/* Inform the privileged process about service and style */ 334/* Inform the privileged process about service, style, and role */
335 335
336void 336void
337mm_inform_authserv(char *service, char *style) 337mm_inform_authserv(char *service, char *style, char *role)
338{ 338{
339 Buffer m; 339 Buffer m;
340 340
@@ -343,12 +343,30 @@ mm_inform_authserv(char *service, char *style)
343 buffer_init(&m); 343 buffer_init(&m);
344 buffer_put_cstring(&m, service); 344 buffer_put_cstring(&m, service);
345 buffer_put_cstring(&m, style ? style : ""); 345 buffer_put_cstring(&m, style ? style : "");
346 buffer_put_cstring(&m, role ? role : "");
346 347
347 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); 348 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
348 349
349 buffer_free(&m); 350 buffer_free(&m);
350} 351}
351 352
353/* Inform the privileged process about role */
354
355void
356mm_inform_authrole(char *role)
357{
358 Buffer m;
359
360 debug3("%s entering", __func__);
361
362 buffer_init(&m);
363 buffer_put_cstring(&m, role ? role : "");
364
365 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m);
366
367 buffer_free(&m);
368}
369
352/* Do the password authentication */ 370/* Do the password authentication */
353int 371int
354mm_auth_password(struct ssh *ssh, char *password) 372mm_auth_password(struct ssh *ssh, char *password)