~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/utils/check-each-file

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# check-each-file
 
3
# Used to narrow down a miscompilation to one .o file from a list. Please read
 
4
# the usage procedure, below, for command-line syntax (or run it with --help).
 
5
# This script depends on the llvm-native-gcc script.
 
6
 
 
7
if [ x$1 = x--make-linker-script ]
 
8
then
 
9
        program=$2
 
10
        linker=./link-$program
 
11
        echo "Building $program with llvm-native-gcc"
 
12
        rm -f $program
 
13
        gmake -e $program CC=llvm-native-gcc CXX=llvm-native-gxx
 
14
        echo "Erasing $program and re-linking it" 
 
15
        rm -f $program
 
16
        echo "rm -f $program" > $linker
 
17
        gmake -n $program >> $linker
 
18
        chmod 755 $linker
 
19
        echo "Linker script created in $linker; testing it out"
 
20
        output=`./$linker 2>&1`
 
21
        case "$output" in
 
22
                *undefined*reference*__main*) 
 
23
                        echo "$program appears to need a dummy __main function; adding one"
 
24
                        echo "void __main () { }" > __main.c
 
25
                        gcc -c __main.c
 
26
                        echo "Done; rebuilding $linker"
 
27
                        echo "rm -f $program" > $linker
 
28
                        gmake -n $program 2>&1 | sed '/gcc/s/$/__main.o/' >> $linker
 
29
                        ./$linker > /dev/null 2>&1
 
30
                        if [ ! -x $program ]
 
31
                        then
 
32
                                echo "WARNING: linker script didn't work"
 
33
                        fi
 
34
                        ;;
 
35
                *)
 
36
                        if [ ! -x $program ]
 
37
                        then
 
38
                                echo "WARNING: linker script didn't work"
 
39
                        fi
 
40
                        ;;
 
41
        esac
 
42
        echo "Linker script created in $linker; please check it manually"
 
43
        exit 0
 
44
fi
 
45
 
 
46
checkfiles="$1"
 
47
program="$2"
 
48
linker="$3"
 
49
checker="$4"
 
50
 
 
51
usage () {
 
52
        myname=`basename $0`
 
53
        echo "$myname --make-linker-script PROGRAM"
 
54
        echo "$myname OBJECTS-FILE PROGRAM LINKER CHECKER"
 
55
        echo ""
 
56
        echo "OBJECTS-FILE is a text file containing the names of all the .o files"
 
57
        echo "PROGRAM is the name of the executable under test"
 
58
        echo "(there must also exist a Makefile in the current directory which"
 
59
        echo "has PROGRAM as a target)"
 
60
        echo "LINKER is the script that builds PROGRAM; try --make-linker-script" 
 
61
        echo "to automatically generate it"
 
62
        echo "CHECKER is the script that exits 0 if PROGRAM is ok, 1 if it is not OK"
 
63
        echo "(LINKER and CHECKER must be in your PATH, or you should specify ./)"
 
64
        echo ""
 
65
        echo "Bugs to <gaeke@uiuc.edu>."
 
66
        exit 1
 
67
}
 
68
 
 
69
if [ x$1 = x--help ]
 
70
then
 
71
        usage
 
72
fi
 
73
 
 
74
if [ -z "$checkfiles" ]
 
75
then
 
76
        echo "ERROR: Must specify name of file w/ list of objects as 1st arg."
 
77
        echo "(got \"$checkfiles\")"
 
78
        usage
 
79
fi
 
80
if [ ! -f "$checkfiles" ]
 
81
then
 
82
        echo "ERROR: $checkfiles not found"
 
83
        usage
 
84
fi
 
85
if [ -z "$program" ]
 
86
then
 
87
        echo "ERROR: Must specify name of program as 2nd arg."
 
88
        usage
 
89
fi
 
90
if [ -z "$linker" ]
 
91
then
 
92
        echo "ERROR: Must specify name of link script as 3rd arg."
 
93
        usage
 
94
fi
 
95
if [ ! -x "$linker" ]
 
96
then
 
97
        echo "ERROR: $linker not found or not executable"
 
98
        echo "You may wish to try: $0 --make-linker-script $program"
 
99
        usage
 
100
fi
 
101
if [ -z "$checker" ]
 
102
then
 
103
        echo "ERROR: Must specify name of $program check script as 3rd arg."
 
104
        usage
 
105
fi
 
106
if [ ! -x "$checker" ]
 
107
then
 
108
        echo "ERROR: $checker not found or not executable"
 
109
        usage
 
110
fi
 
111
 
 
112
files=`cat $checkfiles`
 
113
echo "Recompiling everything with llvm-native-gcc"
 
114
for f in $files
 
115
do
 
116
        rm -f $f
 
117
        gmake $f CC=llvm-native-gcc CXX=llvm-native-gxx
 
118
done
 
119
rm -f $program
 
120
$linker
 
121
if $checker
 
122
then
 
123
        echo "Sorry, I can't help you, $program is OK when compiled with llvm-native-gcc"
 
124
        exit 1
 
125
fi
 
126
for f in $files
 
127
do
 
128
        echo Trying to compile $f with native gcc and rebuild $program
 
129
        mv ${f} ${f}__OLD__
 
130
        gmake ${f} CC=gcc > /dev/null 2>&1
 
131
        $linker
 
132
        echo Checking validity of new $program
 
133
        if $checker
 
134
        then
 
135
                echo Program is OK
 
136
                okfiles="$okfiles $f"
 
137
        else
 
138
                echo Program is not OK
 
139
                notokfiles="$notokfiles $f"
 
140
        fi
 
141
        mv ${f}__OLD__ ${f}
 
142
done
 
143
echo ""
 
144
echo "Program is OK when these files are recompiled with native gcc: "
 
145
echo "$okfiles"
 
146
echo ""
 
147
echo "Program is not OK when these files are recompiled with native gcc: "
 
148
echo "$notokfiles"
 
149
echo ""
 
150
exit 0