Thread: [Rkhunter-users] Bug: Solaris tests fails
Brought to you by:
dogsbody
From: John H. <joh...@pl...> - 2006-02-17 14:49:42
|
Hello, Using RKhunter 1.2.8 on Solaris 9, with the --report-warnings-only option gives an error: expr: non-numeric argument The problem seems to be that the code detects Solaris and switches to using the KSH shell. It then checks (line 311): case `uname` in AIX|SunOS) BEGINTIME=$SECONDS which is fine, but at the end (line 4846) it does: if [ ${OPERATING_SYSTEM} = "AIX" ] ; then ENDTIME=$SECONDS else ENDTIME=`date +%s` fi TOTALTIME=`expr ${ENDTIME} - ${BEGINTIME}` This last test fails. Under Solaris 'date +%s' does nothing, ENDTIME gets set to '%s', and subsequently the expr fails because '%s' is not numeric. Regards, John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |
From: John H. <joh...@pl...> - 2006-02-17 16:43:07
|
On Fri, 2006-02-17 at 17:18 +0100, unspawn wrote: > > On Fri, 17 Feb 2006, John Horne wrote: > > Using RKhunter 1.2.8 on Solaris 9, with the --report-warnings-only > > option gives an error: > > expr: non-numeric argument > > Since Ksh does have variable $SECONDS, changing line 4846 > > if [ ${OPERATING_SYSTEM} = "AIX" ] ; then > to read > if [ ${OPERATING_SYSTEM} = "AIX" -o ${OPERATING_SYSTEM} = "SunOS" ]; then > should do it, right? > Yes. I have tried this and it works fine. > > > This last test fails. Under Solaris 'date +%s' does nothing, ENDTIME > > gets set to '%s', and subsequently the expr fails because '%s' is not > > numeric. > > Under Linux and BSD 'date +%s' shows seconds since start of epoch, > how does Solaris show that? > As far as I can tell it doesn't. I can see nothing in the date/strftime man pages saying anything about a format for the seconds from the start of epoch. John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |