[openssh-commits] [openssh] 07/11: upstream: tweak proctitle to include sshd arguments, as these are
git+noreply at mindrot.org
git+noreply at mindrot.org
Sat Jan 25 11:36:33 AEDT 2020
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit a8c05c640873621681ab64d2e47a314592d5efa2
Author: djm at openbsd.org <djm at openbsd.org>
Date: Fri Jan 24 23:56:01 2020 +0000
upstream: tweak proctitle to include sshd arguments, as these are
frequently used to distinguish between multiple independent instances of the
server. New proctitle looks like this:
$ pgrep -lf sshd
12844 sshd: /usr/sbin/sshd -f /etc/ssh/sshd_config [listener] 0 of 10-100 startups
requested by sthen@ and aja@; ok aja@
OpenBSD-Commit-ID: cf235a561c655a3524a82003cf7244ecb48ccc1e
---
sshd.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/sshd.c b/sshd.c
index c447edfe..46fdf7ee 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.544 2020/01/23 07:10:22 dtucker Exp $ */
+/* $OpenBSD: sshd.c,v 1.545 2020/01/24 23:56:01 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -262,6 +262,8 @@ void destroy_sensitive_data(void);
void demote_sensitive_data(void);
static void do_ssh2_kex(struct ssh *);
+static char *listener_proctitle;
+
/*
* Close all listening sockets
*/
@@ -1087,9 +1089,9 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
*/
for (;;) {
if (ostartups != startups) {
- setproctitle("[listener] %d of %d-%d startups",
- startups, options.max_startups_begin,
- options.max_startups);
+ setproctitle("%s [listener] %d of %d-%d startups",
+ listener_proctitle, startups,
+ options.max_startups_begin, options.max_startups);
ostartups = startups;
}
if (received_sighup) {
@@ -1435,6 +1437,17 @@ accumulate_host_timing_secret(struct sshbuf *server_cfg,
sshbuf_free(buf);
}
+static char *
+prepare_proctitle(int ac, char **av)
+{
+ char *ret = NULL;
+ int i;
+
+ for (i = 0; i < ac; i++)
+ xextendf(&ret, " ", "%s", av[i]);
+ return ret;
+}
+
/*
* Main program for the daemon.
*/
@@ -1911,6 +1924,7 @@ main(int ac, char **av)
rexec_argv[rexec_argc] = "-R";
rexec_argv[rexec_argc + 1] = NULL;
}
+ listener_proctitle = prepare_proctitle(ac, av);
/* Ensure that umask disallows at least group and world write */
new_umask = umask(0077) | 0022;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list