Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 192825 - net-misc/openssh: /etc/init.d/sshd doesn't checkconfig() before restarting sshd, possible lock-out
Summary: net-misc/openssh: /etc/init.d/sshd doesn't checkconfig() before restarting ss...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-17 15:27 UTC by Hans-Werner Hilse
Modified: 2007-09-20 07:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed fix, added check to reload(), added restart() w/ check (sshd-init-script--checkconfig-for-reloads-and-restarts.patch,395 bytes, patch)
2007-09-17 15:28 UTC, Hans-Werner Hilse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Werner Hilse 2007-09-17 15:27:06 UTC
/etc/init.d/sshd contains the function checkconfig() for sanity checking of sshd setup and configuration (using sshd itself for the latter, see also "-t" flag for sshd).

It does this only on "start", thus opening a problem path: Both "restart" and "reload" (specific function for sshd) will shut down a running sshd even if it cannot be started afterwards due to broken setup/configuration.

The patch to be attached by me will just insert the sanity check into restarts/reloads as well, so the admin gets aware before locking himself out.

The lockout however can only be triggered if the admin logs out without caring for the result of the restart/reload. Thus this bug's importance is quite low.

Reproducible: Always

Steps to Reproduce:
1. Make invalid change to sshd_config
2.a. /etc/init.d/sshd restart
2.b. /etc/init.d/sshd reload


Actual Results:  
sshd master process killed, no new one started up

Expected Results:  
sshd complaining on invalid configuration, old instance still running
Comment 1 Hans-Werner Hilse 2007-09-17 15:28:23 UTC
Created attachment 131160 [details, diff]
proposed fix, added check to reload(), added restart() w/ check
Comment 2 SpanKY gentoo-dev 2007-09-20 07:36:12 UTC
fixed in cvs, thanks for the suggestion