Subject: pkg/21353: pkgsrc ssh rc.d script needs fix
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 04/28/2003 21:09:08
>Number:         21353
>Category:       pkg
>Synopsis:       $0 may be "rc" in keygen in pkgsrc ssh rc.d script
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 04:10:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
System: NetBSD rainier.reedmedia.net 1.6 NetBSD 1.6 (JCR-20020927) #3: Sat Sep 28 13:40:20 PDT 2002 reed@rainier.reedmedia.net:/usr/src/sys/arch/i386/compile/JCR-20020927 i386
Architecture: i386
Machine: i386
>Description:
On one of my Linux systems using rcorder and rc.subr, the rc scripts
were ran again and again without stop.
Researching this I found it was doing "rc keygen" so /etc/rc
was starting again each time.
This is because security/openssh/files/sshd.sh
has "$0 keygen" and $0 was not set to /etc/rc.d/sshd.
I see that the real rc.d/sshd script Revision 1.16 gets rid of that
"Don't assume that $0 is this script."
>How-To-Repeat:
	
>Fix:
The fix would be to check for rc.subr again and use
"run_rc_command keygen" instead.

Also, the check for /etc/rc.d directory can be removed
since it checks for a file in the directory after anyways.
>Release-Note:
>Audit-Trail:
>Unformatted: