summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-01-10 09:53:12 +1100
committerDamien Miller <djm@mindrot.org>2003-01-10 09:53:12 +1100
commita8ed44b79e6dd78d7871b0fb8149951b54662ef5 (patch)
treecca59d396ec59133ec1c42536eca25d087dcfcc7 /sshd.c
parent13b2e55c36ec316bd4ec15e830c9eae888d2cb68 (diff)
downloadopenssh-git-a8ed44b79e6dd78d7871b0fb8149951b54662ef5.tar.gz
- (djm) Enable new setproctitle emulation for Linux, AIX and HP/UX. More
systems may be added later.
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sshd.c b/sshd.c
index 8bf1557a..8a7ec6b8 100644
--- a/sshd.c
+++ b/sshd.c
@@ -827,9 +827,17 @@ main(int ac, char **av)
__progname = get_progname(av[0]);
init_rng();
- /* Save argv. */
+ /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
saved_argc = ac;
saved_argv = av;
+ saved_argv = xmalloc(sizeof(*saved_argv) * ac);
+ for (i = 0; i < ac; i++)
+ saved_argv[i] = xstrdup(av[i]);
+
+#ifndef HAVE_SETPROCTITLE
+ /* Prepare for later setproctitle emulation */
+ compat_init_setproctitle(ac, av);
+#endif
/* Initialize configuration options to their default values. */
initialize_server_options(&options);