Seccheck script errors - anything I need to worry about?
Dear List Recently, I've started getting the following message from the seccheck script: Cron <root@mail> test -x /usr/lib/secchk/security-control.sh && /usr/lib/secchk/security-control.sh daily & /usr/lib/secchk/security-daily.sh: line 296: [: too many arguments /usr/lib/secchk/security-daily.sh: line 296: [: too many arguments /usr/lib/secchk/security-daily.sh: line 296: [: too many arguments /usr/lib/secchk/security-daily.sh: line 296: [: too many arguments /usr/lib/secchk/security-daily.sh: line 315: [: too many arguments /usr/lib/secchk/security-daily.sh: line 315: [: too many arguments Looking at the offending lines in the script I get: 292 # .rhosts check 293 awk -F: '{ print $1 " " $6 }' /etc/passwd | 294 while read uid homedir; do 295 for j in .rhosts .shosts; do 296 if [ -s ${homedir}/$j ] ; then 297 rhost=`ls -lcdbg ${homedir}/$j|sed 's/[%\]/_/g'` 298 printf "$uid: $rhost\n" 299 test -f "$j" && { # still a race, however ... 300 if egrep \\+ ${homedir}/$j > /dev/null ; the n 301 printf "\t(has got a plus (+) sign!)\n" 302 fi 303 } 304 fi 305 done 306 done > $OUT 307 if [ -s "$OUT" ] ; then 308 printf "\nChecking for users with .rhosts/.shosts files.\n" 309 cat "$OUT" 310 fi 311 # Check home directories. Directories should not be owned by someone el se 312 # or writeable. 313 awk -F: '/^[^+-]/ { print $1 " " $6 }' /etc/passwd | \ 314 while read uid homedir; do 315 if [ -d ${homedir}/ ] ; then 316 file=`ls -ldb ${homedir}|sed 's/[%\]/_/g'` 317 printf "$uid $file\n" 318 fi 319 done | My knowledge of awk is limited so I can't figure out what is wrong except that it's related to the ${homedir} variable. Is this something I should worry about? Should I just reinstall seccheck or is there something I need to investigate? Thank you and regards Luke Loh
Luke Loh wrote:
My knowledge of awk is limited so I can't figure out what is wrong except that it's related to the ${homedir} variable.
Is this something I should worry about? Should I just reinstall seccheck or is there something I need to investigate?
Maybe you have spaces in the usernames/homes? like /home/bla fasel/? think that would cause it. HTH Sven
On Mon, May 12, 2003 at 08:58:44AM +1000, Luke Loh wrote:
/usr/lib/secchk/security-daily.sh: line 296: [: too many arguments
/usr/lib/secchk/security-daily.sh: line 315: [: too many arguments
try this pseudo patch:
292 # .rhosts check 293 awk -F: '{ print $1 " " $6 }' /etc/passwd | 294 while read uid homedir; do 295 for j in .rhosts .shosts; do
- 296 if [ -s ${homedir}/$j ] ; then + 296 if [ -s "${homedir}/$j" ] ; then
305 done 306 done > $OUT
313 awk -F: '/^[^+-]/ { print $1 " " $6 }' /etc/passwd | \ 314 while read uid homedir; do
- 315 if [ -d ${homedir}/ ] ; then + 315 if [ -d "${homedir}/" ] ; then
My knowledge of awk is limited so I can't figure out what is wrong except that it's related to the ${homedir} variable.
its not awk, but (ba)sh, which croaks. quoting the variable should do it. btw, if you have a more recent bash, and suse >= 7.0 has, you could use [[ ]] instead of the [ ], which does implicit quoting of the arguments. and you need not use awk ... IFS=":"; while read uid _ _ _ _ homedir _ ; do # code here done < /etc/passwd >$OUT IFS=$' \t\n' Lars
participants (3)
-
Lars Ellenberg
-
Luke Loh
-
Sven 'Darkman' Michels