Bug 759 - If sshd was started without explicit pathname, it dies when restarted
Summary: If sshd was started without explicit pathname, it dies when restarted
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-15 09:01 AEDT by Martin Guy
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
Patch to sshd to fix pathless-restart trap (483 bytes, patch)
2003-11-15 09:08 AEDT, Martin Guy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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