#!/bin/bash## OBSERVE: This script takes a bloody long time to finish....# You probably want to > packagelist.log or something.#FILELIST=$(tempfile) # Files to be tested for badnessTMPLIST=$(tempfile) # Temporary file with verified-bad filesMATCHLIST=$(tempfile) # TMPFILE entries stripped of the leading / to match the slackware package log format# Fist find the .la files we know are badfind /etc/X11/xdm -name "*.la" -print0 | xargs -0 grep "xcb-xlib.la" | cut -d : -f 1 >> $TMPLISTfind /usr/lib -name "*.la" -print0 | xargs -0 grep "xcb-xlib.la" | cut -d : -f 1 >> $TMPLIST# Then find anything that could possibly be infectedfind /usr/bin -type f -print0 | xargs -0 file | grep "executable" | grep ELF | cut -f 1 -d : >> $FILELISTfind /usr/lib -type f -print0 | xargs -0 file | grep "shared object" | grep ELF | cut -f 1 -d : >> $FILELIST# Check which files have a direct dependency on xcb-xlibfor i in $(cat $FILELIST); do if objdump -p $i | grep NEEDED | grep libxcb-xlib.so > /dev/null; then echo $i >> $TMPLIST fidone# Format things in a slackish way :Pcat $TMPLIST | cut -d \/ -f1 --complement > $MATCHLIST# See which packages these files come fromgrep -l -f $MATCHLIST /var/log/packages/*# Clean up before we close for today...rm $FILELIST $TMPLIST $MATCHLIST