Bug 759

Summary: If sshd was started without explicit pathname, it dies when restarted
Product: Portable OpenSSH Reporter: Martin Guy <martin>
Component: sshdAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED WONTFIX    
Severity: normal    
Priority: P2    
Version: -current   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
Patch to sshd to fix pathless-restart trap none

Description Martin Guy 2003-11-15 09:01:32 AEDT
Hi!
   We just had a major panic being unable to access our site server via ssh for
a day.  We thought we'd have to get on a plane and go physically to where it is
hosted but fortunately one of our gurus managed to find some security exploits
to get in and restart sshd.
   The cause turned out to be that someone had installed the latest version of
OpenSSH, had killed and restarted sshd by saying "sshd"... one and a half months
later, I came to reconfigure it, kill -HUPped it, and it just died because there
was no "sshd" in its current directory.  I didn't notice and logged out. 
Consequence: machine unaccessible to fix it (it's hosted in another country from
where everybody lives).

The fix is for the restart code to allow for this possibility and, if argv[0]
doesn't contain any / characters, to try execvp after the initial execv in sshd.c

If I can find a button that says "attach", I'll attach the diffs...

All the best!
Comment 1 Martin Guy 2003-11-15 09:08:16 AEDT
Created attachment 499 [details]
Patch to sshd to fix pathless-restart trap
Comment 2 Markus Friedl 2003-11-15 09:48:38 AEDT
no, i don't think this will change.

the current behaviour is documented, and your
change will cause sshd to restart the first
sshd from the $PATH.  this is not really
predictable behaviour.
Comment 3 Markus Friedl 2003-11-15 09:56:14 AEDT
     sshd rereads its configuration file when it receives a hangup signal,
     SIGHUP, by executing itself with the name it was started as, i.e.,
     /usr/sbin/sshd.

Comment 4 Damien Miller 2004-04-14 12:24:20 AEST
Mass change of RESOLVED bugs to CLOSED