https://bugzilla.mindrot.org/show_bug.cgi?id=1883

--- Comment #1 from Damien Miller <[email protected]> 2011-04-12 15:37:26 EST ---
Comment on attachment 2024
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2024
implementation

>@@ -230,12 +230,25 @@ main(int ac, char **av)
>       struct servent *sp;
>       Forward fwd;
> 
>-      /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
>-      sanitise_stdfd();
>-
>       __progname = ssh_get_progname(av[0]);
>       init_rng();
> 
>+#ifndef HAVE_SETPROCTITLE
>+      /* Prepare for later setproctitle emulation */
>+      {
>+              /* Save argv. Duplicate so setproctitle emulation doesn't 
>clobber it */
>+              char **saved_argv = xcalloc(ac + 1, sizeof(*saved_argv));
>+              for (i = 0; i < ac; i++)
>+                      saved_argv[i] = xstrdup(av[i]);
>+              saved_argv[i] = NULL;
>+              compat_init_setproctitle(ac, av);
>+              av = saved_argv;

compat_init_setproctitle() should save everything that is necessary. Is
it not working for you?

Also, why reorder the sanitise_stdfd() call?

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to