=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshd.c,v retrieving revision 1.544 retrieving revision 1.545 diff -u -r1.544 -r1.545 --- src/usr.bin/ssh/sshd.c 2020/01/23 07:10:22 1.544 +++ src/usr.bin/ssh/sshd.c 2020/01/24 23:56:01 1.545 @@ -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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -240,6 +240,8 @@ void demote_sensitive_data(void); static void do_ssh2_kex(struct ssh *); +static char *listener_proctitle; + /* * Close all listening sockets */ @@ -1032,9 +1034,9 @@ */ 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) { @@ -1347,6 +1349,17 @@ 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. */ @@ -1774,6 +1787,7 @@ 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;