Show
Ignore:
Timestamp:
2001-01-08 08:33:57 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Going through possible security problems with a fine comb. If you
want to help, check out the current source, and run check_sec.sh.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • check_sec.sh

    r2236 r2237  
    55# 
    66 
    7 TMPFILE="`mktemp fopen.XXXXXX`" || exit 1 
    8 grep -n '\<fopen.*".*w' *.c */*.c | fgrep -v __FOPEN_CHECKED__  > $TMPFILE 
    9 test -s $TMPFILE && { 
    10         echo "WARNING: UNCHECKED FOPEN CALLS FOUND" ; 
    11         cat $TMPFILE ; 
    12         exit 1; 
     7TMPFILE="`mktemp check_sec.tmp.XXXXXX`" || exit 1 
     8 
     9do_check () 
     10{ 
     11        egrep -n "$1" *.c */*.c | fgrep -v $2 > $TMPFILE 
     12        test -s $TMPFILE && { 
     13                echo "$3" ; 
     14                cat $TMPFILE; 
     15                exit 1; 
     16        } 
    1317} 
     18 
     19 
     20 
     21do_check '\<fopen.*'\"'.*w' __FOPEN_CHECKED__ "Alert: Unchecked fopen calls." 
     22do_check '\<(mutt_)?strcpy' __STRCPY_CHECKED__ "Alert: Unchecked strcpy calls." 
     23# do_check '\<strcat' __STRCAT_CHECKED__ "Alert: Unchecked strcat calls." 
     24do_check 'sprintf.*%s' __SPRINTF_CHECKED__ "Alert: Unchecked sprintf calls." 
    1425 
    1526rm -f $TMPFILE