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