Skip to content

Commit

Permalink
Merge pull request #173 from extremeshok/dev
Browse files Browse the repository at this point in the history
Version 5.6 (updated 2017-03-17)
  • Loading branch information
extremeshok authored Mar 17, 2017
2 parents 1c41d51 + 8f5f942 commit 593af35
Show file tree
Hide file tree
Showing 47 changed files with 2,458 additions and 1,803 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cvd filter=lfs diff=lfs merge=lfs -text
26 changes: 26 additions & 0 deletions .t/ci-clamav-clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Cleaning CI enviroment"

rm -f /etc/cron.d/clamav-unofficial-sigs
rm -f /etc/logrotate.d/clamav-unofficial-sigs
rm -f /usr/share/man/man8/clamav-unofficial-sigs.8
rm -rf /var/lib/clamav-unofficial-sigs

service clamav-daemon stop
apt-get purge libclamav6 clamav-base clamav-freshclam clamav clamav-daemon -qq
rm -rf /var/lib/clamav

echo .. OK

#force the exit to 0
exit 0
46 changes: 46 additions & 0 deletions .t/ci-clamav-download-default-databases-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Downloading latest clamav databases"

wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/bytecode.cvd.7z
7za e bytecode.cvd.7z
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi

wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/daily.cvd.7z.003
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/daily.cvd.7z.002
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/daily.cvd.7z.001
7za e daily.cvd.7z.001
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi

wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.006
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.005
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.004
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.003
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.002
wget -nv -t 9 https://github.com/extremeshok/clamav-sample-db/raw/master/main.cvd.7z.001
7za e main.cvd.7z.001
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
36 changes: 36 additions & 0 deletions .t/ci-clamav-download-default-databases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Downloading latest clamav databases"

wget -nv -t 9 http://database.clamav.net/bytecode.cvd
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi

wget -nv -t 9 http://database.clamav.net/daily.cvd
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi

wget -nv -t 9 http://database.clamav.net/main.cvd
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
25 changes: 25 additions & 0 deletions .t/ci-clamav-install-default-database.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Installing latest clamav databases"

mkdir -p /var/lib/clamav
cp -f bytecode.cvd /var/lib/clamav/bytecode.cvd
cp -f daily.cvd /var/lib/clamav/daily.cvd
cp -f main.cvd /var/lib/clamav/main.cvd
chown -R clamav:clamav /var/lib/clamav
service clamav-daemon start
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
20 changes: 20 additions & 0 deletions .t/ci-clamav-install-default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Installing default Clamav"

apt-get install libclamav6 clamav-base clamav-freshclam clamav clamav-daemon -qq
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
76 changes: 76 additions & 0 deletions .t/ci-clamav-install-wheezy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Installing clamav 0.99 from Debian wheezy"

wget -nv -t 9 http://ftp.debian.org/debian/pool/main/l/llvm-3.0/libllvm3.0_3.0-10_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/libf/libffi/libffi5_3.0.10-3_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/c/clamav/libclamav7_0.99+dfsg-0+deb7u2_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/c/clamav/clamav-base_0.99+dfsg-0+deb7u2_all.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/c/clamav/clamav-freshclam_0.99+dfsg-0+deb7u2_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/c/clamav/clamav-daemon_0.99+dfsg-0+deb7u2_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
wget -nv -t 9 http://ftp.debian.org/debian/pool/main/c/clamav/clamav_0.99+dfsg-0+deb7u2_amd64.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
dpkg -i *.deb
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
apt-get install -y -f
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
19 changes: 19 additions & 0 deletions .t/ci-disable-gpg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Disabling GPG support"
echo "enable_gpg=\"no\"" >> /etc/clamav-unofficial-sigs/user.conf
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
9 changes: 7 additions & 2 deletions .t/ci-force.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/sh

echo .. forced OK
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
echo .. forced OK
19 changes: 19 additions & 0 deletions .t/ci-shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Shellcheck-ing script"
shellcheck --exclude=SC2128,SC2154,SC2001 --shell=bash clamav-unofficial-sigs.sh
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
39 changes: 29 additions & 10 deletions .t/ci-test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#!/bin/sh

###################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
# License: BSD (Berkeley Software Distribution)
##################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin

pwd

echo "Remove test signature if it exists. "
if [ -e "/var/lib/clamav/sanesecurity.ftm" ] ; then
rm -f /var/lib/clamav/sanesecurity.ftm
fi

echo "running script as root"
sudo bash /usr/sbin/clamav-unofficial-sigs
if [ "$?" -eq "0" ] ; then
Expand All @@ -22,19 +32,19 @@ else
exit 1
fi

echo "check gpg file was downloaded"
if [ -e "/var/lib/clamav-unofficial-sigs/gpg-key/publickey.gpg" ] ; then
echo .. OK
echo "check signature placed correctly"
if [ -e "/var/lib/clamav/sanesecurity.ftm" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
exit 1
fi

echo "check cron file generation"
bash clamav-unofficial-sigs.sh --install-cron
if [ "$?" -eq "0" ] ; then
if [ -e "/etc/cron.d/clamav-unofficial-sigs" ] ; then
echo .. OK
echo .. OK
else
echo .. ERROR
exit 1
Expand All @@ -48,7 +58,7 @@ echo "check logrotate file generation"
bash clamav-unofficial-sigs.sh --install-logrotate
if [ "$?" -eq "0" ] ; then
if [ -e "/etc/logrotate.d/clamav-unofficial-sigs" ] ; then
echo .. OK
echo .. OK
else
echo .. ERROR
exit 1
Expand All @@ -62,7 +72,7 @@ echo "check man file generation"
bash clamav-unofficial-sigs.sh --install-man
if [ "$?" -eq "0" ] ; then
if [ -e "/usr/share/man/man8/clamav-unofficial-sigs.8" ] ; then
echo .. OK
echo .. OK
else
echo .. ERROR
exit 1
Expand All @@ -75,7 +85,7 @@ fi
echo "check database integrity test"
bash clamav-unofficial-sigs.sh --test-database sanesecurity.ftm
if [ "$?" -eq "0" ] ; then
echo .. OK
echo .. OK
else
echo .. ERROR
exit 1
Expand All @@ -84,9 +94,18 @@ fi
echo "check gpg verify test"
bash clamav-unofficial-sigs.sh --gpg-verify scam.ndb
if [ "$?" -eq "0" ] ; then
echo .. OK
echo .. OK
else
echo .. ERROR
exit 1
fi

echo "check clamav-daemon service will start"
service clamav-daemon stop
service clamav-daemon start
if [ "$?" -eq "0" ] ; then
echo .. OK
else
echo .. ERROR
exit 1
fi
3 changes: 3 additions & 0 deletions .t/clamdb/sample-bytecode.cvd
Git LFS file not shown
Binary file removed .t/tests/bytecode.cvd
Binary file not shown.
Loading

0 comments on commit 593af35

Please sign in to comment.