Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 90007
Collapse All | Expand All

(-)rkhunter.orig/files/check_update.sh (-17 / +6 lines)
Lines 52-66 Link Here
52
  {
52
  {
53
    echo -n "${FILEDESC}: "  
53
    echo -n "${FILEDESC}: "  
54
    UPDATEDBURL="${FIRSTMIRROR}/${VERSIONUPDATEURL}"
54
    UPDATEDBURL="${FIRSTMIRROR}/${VERSIONUPDATEURL}"
55
    ${WGETBINARY} -q -O /tmp/rkhunter.upd ${UPDATEDBURL}
55
56
    
56
	if ! LATESTVERSION=`${WGETBINARY} -q -O - ${UPDATEDBURL}`; then
57
    if [ -f /tmp/rkhunter.upd ]; then
58
        LATESTVERSION=`cat /tmp/rkhunter.upd`
59
        rm -f /tmp/rkhunter.upd
60
      else
61
        echo "ERROR"
57
        echo "ERROR"
62
        echo "Fatal error: Problem while fetching file"
58
        echo "Fatal error: Problem while fetching file"
63
	exit 1
59
		exit 1
64
    fi
60
    fi
65
      
61
      
66
    CURRENTVERSION=`cat ${DBDIR}/${FILENAME} | grep '000:version' | cut -d ':' -f3`
62
    CURRENTVERSION=`cat ${DBDIR}/${FILENAME} | grep '000:version' | cut -d ':' -f3`
Lines 89-100 Link Here
89
85
90
	    # Fetch file
86
	    # Fetch file
91
	    GETFILE="${FIRSTMIRROR}/${FILENAME}.gz"
87
	    GETFILE="${FIRSTMIRROR}/${FILENAME}.gz"
92
	    ${WGETBINARY} -q -O /tmp/rkhunter.upd.gz ${GETFILE}
88
		TMPFILE="`mktemp /tmp/rkhunter.upd.gz.XXXXXX`" || exit 1
93
	    if [ $? -eq 0 ]
89
	    if ${WGETBINARY} -q -O - ${GETFILE} | gunzip -c > ${TMPFILE}; then
94
	      then
90
	        mv ${TMPFILE} ${DBDIR}/${FILENAME}
95
	        # Gunzip it and place it on the right location
96
	        gunzip /tmp/rkhunter.upd.gz
97
	        mv /tmp/rkhunter.upd ${DBDIR}/${FILENAME}
98
		echo "  Action: Database updated (current version: ${CURRENTVERSION}, new version ${LATESTVERSION})"
91
		echo "  Action: Database updated (current version: ${CURRENTVERSION}, new version ${LATESTVERSION})"
99
	      else
92
	      else
100
	        echo "Fatal error: Can't retrieve file: ${GETFILE}"
93
	        echo "Fatal error: Can't retrieve file: ${GETFILE}"
Lines 126-135 Link Here
126
        rm -f ${MIRRORFILE}.new
119
        rm -f ${MIRRORFILE}.new
127
    fi
120
    fi
128
121
129
    if [ -f /tmp/rkhunter.upd ]; then
130
      rm -f /tmp/rkhunter.upd
131
    fi
132
133
    touch ${MIRRORFILE}.new
122
    touch ${MIRRORFILE}.new
134
    echo "${MIRRORSVERSION}" > ${MIRRORFILE}.new
123
    echo "${MIRRORSVERSION}" > ${MIRRORFILE}.new
135
    for I in ${OTHERMIRRORS}; do
124
    for I in ${OTHERMIRRORS}; do
(-)rkhunter.orig/files/rkhunter (-3 / +3 lines)
Lines 4421-4436 Link Here
4421
                VERSION=`${I}/php -v | head -n 1 | awk '{ print $2 }'`
4421
                VERSION=`${I}/php -v | head -n 1 | awk '{ print $2 }'`
4422
                ;;
4422
                ;;
4423
          procmail)
4423
          procmail)
4424
                VERSION=`${I}/procmail -v 2> /tmp/procmail.txt && cat /tmp/procmail.txt | grep 'procmail v' | awk '{ print $2 }' | tr -d 'v' && rm -f /tmp/procmail.txt`
4424
                VERSION=`${I}/procmail -v 2>&1 | grep 'procmail v' | awk '{ print $2 }' | tr -d 'v'`
4425
                ;;
4425
                ;;
4426
          proftpd)
4426
          proftpd)
4427
                VERSION=`${I}/proftpd -v 2> /tmp/proftpd.txt && cat /tmp/proftpd.txt | awk '{ print $4 }' && rm -f /tmp/proftpd.txt`
4427
                VERSION=`${I}/proftpd -v 2>&1 | awk '{ print $4 }'`
4428
                ;;
4428
                ;;
4429
          squid)
4429
          squid)
4430
                VERSION=`${I}/squid -v | grep 'Squid Cache' | awk '{ print $4 }'`
4430
                VERSION=`${I}/squid -v | grep 'Squid Cache' | awk '{ print $4 }'`
4431
                ;;
4431
                ;;
4432
          sshd)
4432
          sshd)
4433
                VERSION=`${I}/sshd -t -d 2> /tmp/openssh.txt && cat /tmp/openssh.txt | head -n 1 | awk '{ print $4 }' | cut -d '_' -f2 && rm -f /tmp/openssh.txt`
4433
                VERSION=`${I}/sshd -t -d 2>&1 | head -n 1 | awk '{ print $4 }' | cut -d '_' -f2`
4434
		if [ ! "`echo "${VERSION}" | grep "+"`" = "" ]; then
4434
		if [ ! "`echo "${VERSION}" | grep "+"`" = "" ]; then
4435
		  VERSION=`echo "${VERSION}" | cut -d'+' -f1`
4435
		  VERSION=`echo "${VERSION}" | cut -d'+' -f1`
4436
		fi
4436
		fi

Return to bug 90007