FS#18799 - sshd rc script incorrectly identifying PID of existing instances

Attached to Project: Arch Linux
Opened by Phillip Smith (fukawi2) - Tuesday, 23 March 2010, 03:26 GMT
Last edited by Allan McRae (Allan) - Wednesday, 24 March 2010, 02:43 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The rc script for sshd currently uses the following line to determine the PID of any running daemons:
PID=$(pidof -o %PPID /usr/sbin/sshd)

This incorrectly matches any processes of users *already* logged in, even if the actual listening daemon is not running.

Perhaps a better way is to use pgrep or `netstat -tnlp | egrep '/sshd$'`

Additional info:
Version : 5.3p1-4

Steps to reproduce:
1) Login via SSH
2) Shutdown the sshd daemon
3) Attempt the restart the daemon. It will fail because the PID identification line above incorrectly matches the sshd process of your login.
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 24 March 2010, 02:43 GMT
Reason for closing:  Fixed
Comment by Pierre Schmitz (Pierre) - Tuesday, 23 March 2010, 07:08 GMT
Update to openssh 5.4p1-3

PS: Just noticed: this version is still in testing though.
Comment by Phillip Smith (fukawi2) - Wednesday, 24 March 2010, 02:22 GMT
Ah, this is fixed in that release. Awesome, thanks Pierre :)

Loading...