Bug in sshd bootscript

Jochen Held joh at acentec.de
Fri Jan 17 08:09:06 PST 2003


On Fri, Jan 17, 2003 at 09:25:37AM -0600, Larry wrote:
> On Fri, Jan 17, 2003 at 09:51:42AM +0100, Debian User wrote:
> > 
> > I only "copy and paste" the scripts from BLFS-Book and it seems the path
> > isn't the problem in lfs-bootscripts but in sshd.
> > 
> > sshd.c:
> > /*
> >  * Called from the main program after receiving SIGHUP.
> >  * Restarts the server.
> >  */
> > static void
> > sighup_restart(void)
> > {
> > 	log("Received SIGHUP; restarting.");
> > 	close_listen_socks();
> > 	close_startup_pipes();
> > 	execv(saved_argv[0], saved_argv);
> > 	log("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
> > 	    strerror(errno));
> > 	exit(1);
> > }
> > 
> > If sshd is invoked as "sshd" it can't find it's executable at restart.
> > Does it clear it's environment ?
> 
> It would be using the environment set when it was invoked. Do you have
> /usr/sbin in your path statement for root?
> 

Yes and it's also included in /etc/rc.d/init.d/sshd with "source
$rc_functions".  In this case sshd is invoked by the shell with
"correct" environment.  At restart/reload sshd is invoked by *itself*
(see C-code from sshd.c) with clearedout environtment, I thought. (Sorry
I'm currently to busy to search this code in OpenSSH.)

> I have to test my reload locally, so that will be in a few hours.  I
> will try to resolve this this weekend.
> 
> Larry

CU on monday Jochen.
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list