This file is indexed.

/usr/share/debian-cd/tools/grab_md5 is in debian-cd 3.1.13.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh
#
# grab_md5
# (c) 2004 Steve McIntyre <steve@einval.com>
#
# GPL v2
#
# Parse Packages and Sources files out of a mirror and pre-process
# them into a single list ready for mkisofs to check later

set -e

MIRROR=$1
ARCHES="$2"
CODENAME=$3
DI_CODENAME=$4
OUT=$5

for ARCH in $ARCHES
do
    LOCATIONS="$MIRROR/dists/$CODENAME/ $MIRROR/dists/$DI_CODENAME/"
    echo "Looking in $LOCATIONS"

    for LOCATION in $LOCATIONS; do
        if [ ! -d $LOCATION ]; then
            echo "Error: $LOCATION is not a directory"
            exit 1
        fi
    done

    case $ARCH in
        source)
            FILES=`find $LOCATIONS -name Sources.gz`
            echo "Using MD5 sums from Sources files:"
            echo $FILES
            zcat -f $FILES | MIRROR=$MIRROR perl -ne '
                chomp;
                my %files;
                my $dir;
                my $mirror = $ENV{"MIRROR"};
                my $filename;
                while (<>) {
                    if (m/^ ([[:xdigit:]]{32}) (\d+) (\S+)/sg) {
                        $files{$3}{"md5"} = $1;
                        $files{$3}{"size"} = $2;
                    }
                    if (m/^Directory: (\S+)/sg) {
                        $dir = $1;
                    }
                    if (m/^$/) {
                        for $filename (keys %files) {
                            printf("%s  %12s  %s/%s/%s\n",
                                $files{$filename}{"md5"},
                                $files{$filename}{"size"},
                                $mirror, $dir, $filename);
                        }
                        undef %files;
                    }
                }' | sort | uniq >> $OUT
            ;;
        *)
            FILES=`find $LOCATIONS -name Packages.gz | grep binary-$ARCH`
            echo "Using MD5 sums from Packages files:"
            echo $FILES
            NUM_FILES=`echo $FILES | wc -w`
            if [ $NUM_FILES -eq 1 ] ; then
                echo "No files found for arch $ARCH. Abort!"
                exit 1
            fi
            zcat -f $FILES | MIRROR=$MIRROR perl -ne '
                chomp;
                my $mirror = $ENV{"MIRROR"};
                my $filename;
                my $size;
                my $md5;
                while (<>) {
                    if (m/^Filename: (\S+)/sg) {
                        $filename = $1;
                    }
                    if (m/^Size: (\S+)/sg) {
                        $size = $1;
                    }
                    if (m/^MD5sum: (\S+)/sg) {
                        $md5 = $1;
                    }
                    if (m/^$/) {
                        printf("%s  %12s  %s/%s\n", $md5, $size, $mirror, $filename);
                    }
                }' | sort | uniq >> $OUT
            # Use the new D-I images. Do NOT use the "current"
            # link; it causes problems with overlaid files...
            for VER in $MIRROR/dists/$DI_CODENAME/main/installer-$ARCH/*
            do
                if [ -d $VER ] && [ ! -L $VER ] ; then
                    FILE=$VER/images/MD5SUMS
                    echo "Using MD5 sums from d-i: $FILE"
                    LOC=dists/$DI_CODENAME/main/installer-$ARCH/`basename $VER`/images
                    for ENTRY in `cat $FILE | sed 's/  /:/g'`
                    do
                        PATH=`echo $ENTRY | /bin/sed "s?^.*:\./?$MIRROR/$LOC/?g"`
                        MD5=`echo $ENTRY | /bin/sed 's/:.*$//g'`
                        SIZE=`/usr/bin/stat -c %s $PATH`
                        printf '%s  %12.12s  %s\n' $MD5 $SIZE $PATH
                    done | sort | uniq >> $OUT
                 fi
            done
            ;;             
    esac
done

exit 0