Skip to content

Commit

Permalink
put back some portable bits for sshd-auth.c
Browse files Browse the repository at this point in the history
  • Loading branch information
djmdjm committed Oct 14, 2024
1 parent f8edf08 commit 164ea43
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions sshd-auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <paths.h>
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
#include <pwd.h>
#include <grp.h>
#include <signal.h>
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 164ea43

Please sign in to comment.