summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-08-03 08:04:31 +0000
committertrasz <trasz@FreeBSD.org>2015-08-03 08:04:31 +0000
commita0b545acc62cb53c9d5e843e88a99d88d40b73b4 (patch)
tree23ee0d7f8db4ede017dd122c651d331b59a4cf28
parent8c8a81ecdf4f043c848667960bad5efd8191206b (diff)
downloadFreeBSD-src-a0b545acc62cb53c9d5e843e88a99d88d40b73b4.zip
FreeBSD-src-a0b545acc62cb53c9d5e843e88a99d88d40b73b4.tar.gz
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
-rw-r--r--sys/kern/kern_proc.c2
-rw-r--r--usr.sbin/ctld/login.c3
2 files changed, 1 insertions, 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);
OpenPOWER on IntegriCloud