From a0b545acc62cb53c9d5e843e88a99d88d40b73b4 Mon Sep 17 00:00:00 2001 From: trasz Date: Mon, 3 Aug 2015 08:04:31 +0000 Subject: MFC r282086: Make setproctitle(3) work in Capsicum capability mode. This makes ctld(8) child processes to indicate initiator address and name in their titles, similar to what iscsid(8) child processes do. PR: 181352 Sponsored by: The FreeBSD Foundation --- sys/kern/kern_proc.c | 2 +- usr.sbin/ctld/login.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 4f103b2..63ecf0f 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2782,7 +2782,7 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD | CTLFLAG_MPSAFE sysctl_kern_proc, "Return process table, no threads"); static SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args, - CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, + CTLFLAG_RW | CTLFLAG_CAPWR | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_args, "Process argument list"); static SYSCTL_NODE(_kern_proc, KERN_PROC_ENV, env, CTLFLAG_RD | CTLFLAG_MPSAFE, diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index 865a19a..dc0dba6 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -789,9 +789,6 @@ login(struct connection *conn) } conn->conn_initiator_name = checked_strdup(initiator_name); log_set_peer_name(conn->conn_initiator_name); - /* - * XXX: This doesn't work (does nothing) because of Capsicum. - */ setproctitle("%s (%s)", conn->conn_initiator_addr, conn->conn_initiator_name); redirected = login_portal_redirect(conn, request); -- cgit v1.1