RedHat sshd.init script typo ?

Smith, Donald Donald.Smith at qwest.com
Wed Nov 8 03:57:48 EST 2000



Donald Smith
Staff IP Engineer
IP Network Engineering Security
303-226-9939 Office
303-226-0688 fax
720-320-1537 cell


> -----Original Message-----
> From: Jarno Huuskonen [mailto:jhuuskon at messi.uku.fi]
> Sent: Tuesday, November 07, 2000 6:11 AM
> To: openssh-unix-dev at mindrot.org
> Subject: RedHat sshd.init script typo ?
> 
> 
> Hi,
> 
> I noticed one small possible error in the 
> openssh-2.3.0p1/contrib/redhat/sshd.init script.
> In the stop option:
>         stop)
>                 echo -n "Shutting down sshd: "
>                 if [ -f $PID_FILE ] ; then
>                         killproc sshd
>                         [ $RETVAL -eq 0 ] && rm -f 
Why bother assigning RETVAL then comparing it to 0. How about a comment
explaining $? 
# The return value from killproc is stored in $? (normal sh behavior) then
				[ $? -eq 0 ] && rm -f /var/lock/subsys/sshd
>                 fi
>                 echo
This saves an assignment helps newbies understand that in borneshell $? is
the decimal value returned by the last synchronously executed command. 
> 
> Shouldn't there be RETVAL=$? after killproc sshd ?
> If this is the case here's a patch:
> 
> --- sshd.init~	Mon Oct 16 04:25:17 2000
> +++ sshd.init	Tue Nov  7 15:06:16 2000
> @@ -72,6 +72,7 @@
>  		echo -n "Shutting down sshd: "
>  		if [ -f $PID_FILE ] ; then
>  			killproc sshd
> +			RETVAL=$?
>  			[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd
>  		fi
>  		echo
> 
> -Jarno
> 
> -- 
> Jarno Huuskonen - System Administrator   |  Jarno.Huuskonen at uku.fi
> University of Kuopio - Computer Centre   |  Work:   +358 17 162822
> PO BOX 1627, 70211 Kuopio, Finland       |  Mobile: +358 40 5388169
> 





More information about the openssh-unix-dev mailing list