diff options
-rw-r--r-- | sshd.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.544 2020/01/23 07:10:22 dtucker Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.545 2020/01/24 23:56:01 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -262,6 +262,8 @@ void destroy_sensitive_data(void); | |||
262 | void demote_sensitive_data(void); | 262 | void demote_sensitive_data(void); |
263 | static void do_ssh2_kex(struct ssh *); | 263 | static void do_ssh2_kex(struct ssh *); |
264 | 264 | ||
265 | static char *listener_proctitle; | ||
266 | |||
265 | /* | 267 | /* |
266 | * Close all listening sockets | 268 | * Close all listening sockets |
267 | */ | 269 | */ |
@@ -1087,9 +1089,9 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) | |||
1087 | */ | 1089 | */ |
1088 | for (;;) { | 1090 | for (;;) { |
1089 | if (ostartups != startups) { | 1091 | if (ostartups != startups) { |
1090 | setproctitle("[listener] %d of %d-%d startups", | 1092 | setproctitle("%s [listener] %d of %d-%d startups", |
1091 | startups, options.max_startups_begin, | 1093 | listener_proctitle, startups, |
1092 | options.max_startups); | 1094 | options.max_startups_begin, options.max_startups); |
1093 | ostartups = startups; | 1095 | ostartups = startups; |
1094 | } | 1096 | } |
1095 | if (received_sighup) { | 1097 | if (received_sighup) { |
@@ -1435,6 +1437,17 @@ accumulate_host_timing_secret(struct sshbuf *server_cfg, | |||
1435 | sshbuf_free(buf); | 1437 | sshbuf_free(buf); |
1436 | } | 1438 | } |
1437 | 1439 | ||
1440 | static char * | ||
1441 | prepare_proctitle(int ac, char **av) | ||
1442 | { | ||
1443 | char *ret = NULL; | ||
1444 | int i; | ||
1445 | |||
1446 | for (i = 0; i < ac; i++) | ||
1447 | xextendf(&ret, " ", "%s", av[i]); | ||
1448 | return ret; | ||
1449 | } | ||
1450 | |||
1438 | /* | 1451 | /* |
1439 | * Main program for the daemon. | 1452 | * Main program for the daemon. |
1440 | */ | 1453 | */ |
@@ -1911,6 +1924,7 @@ main(int ac, char **av) | |||
1911 | rexec_argv[rexec_argc] = "-R"; | 1924 | rexec_argv[rexec_argc] = "-R"; |
1912 | rexec_argv[rexec_argc + 1] = NULL; | 1925 | rexec_argv[rexec_argc + 1] = NULL; |
1913 | } | 1926 | } |
1927 | listener_proctitle = prepare_proctitle(ac, av); | ||
1914 | 1928 | ||
1915 | /* Ensure that umask disallows at least group and world write */ | 1929 | /* Ensure that umask disallows at least group and world write */ |
1916 | new_umask = umask(0077) | 0022; | 1930 | new_umask = umask(0077) | 0022; |