From: Damien Miller Date: Mon, 14 Oct 2024 06:16:41 +0000 (+1100) Subject: put back some portable bits for sshd-auth.c X-Git-Tag: V_10_0_P1~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=164ea4380564a2a83713eacf71908e3946e5e4e4;p=thirdparty%2Fopenssh-portable.git put back some portable bits for sshd-auth.c --- diff --git a/sshd-auth.c b/sshd-auth.c index 52bbd0b9a..53658cf11 100644 --- a/sshd-auth.c +++ b/sshd-auth.c @@ -42,7 +42,9 @@ #include #include #include -#include +#ifdef HAVE_PATHS_H +# include +#endif #include #include #include @@ -456,8 +458,23 @@ main(int ac, char **av) sigemptyset(&sigmask); sigprocmask(SIG_SETMASK, &sigmask, NULL); - /* Save argv. */ - saved_argv = av; +#ifdef HAVE_SECUREWARE + (void)set_auth_parameters(ac, av); +#endif + __progname = ssh_get_progname(av[0]); + + /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ + saved_argc = ac; + saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); + for (i = 0; (int)i < ac; i++) + saved_argv[i] = xstrdup(av[i]); + saved_argv[i] = NULL; + +#ifndef HAVE_SETPROCTITLE + /* Prepare for later setproctitle emulation */ + compat_init_setproctitle(ac, av); + av = saved_argv; +#endif /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ sanitise_stdfd();