diff options
author | Chris Rees <crees@FreeBSD.org> | 2011-06-29 19:37:51 +0000 |
---|---|---|
committer | Chris Rees <crees@FreeBSD.org> | 2011-06-29 19:37:51 +0000 |
commit | d2f0ac5fa3a2387db7f2f77afb13939bcbe2de48 (patch) | |
tree | bf0ebca46fc68899ebfcde7885e3c51742f027f0 /security/clamav | |
parent | cc3aeca04b720add9f71bb6d3fe80a02ff959df9 (diff) | |
download | ports-d2f0ac5fa3a2387db7f2f77afb13939bcbe2de48.tar.gz ports-d2f0ac5fa3a2387db7f2f77afb13939bcbe2de48.zip |
Notes
Diffstat (limited to 'security/clamav')
-rw-r--r-- | security/clamav/files/patch-unit_tests-check_common_sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/security/clamav/files/patch-unit_tests-check_common_sh b/security/clamav/files/patch-unit_tests-check_common_sh new file mode 100644 index 000000000000..6bc88a25792c --- /dev/null +++ b/security/clamav/files/patch-unit_tests-check_common_sh @@ -0,0 +1,24 @@ +$RANDOM is a bashism, it has been replaced with portable code. + +Also, the randomly generated port is checked to make sure it's not already +in use. + +--- unit_tests/check_common.sh.orig 2011-05-13 12:25:31.000000000 +0100 ++++ unit_tests/check_common.sh 2011-06-28 19:12:00.683905036 +0100 +@@ -58,9 +58,13 @@ + aa15bcf478d165efd2065190eb473bcb:544:ClamAV-Test-File + EOF + port=331$1 +- if test "x$RANDOM" != "x"; then +- port=1`expr 100 + \( $RANDOM % 899 \)`$1 +- fi ++ tries=0 ++ while nc -z localhost $port 2>/dev/null ++ do rand=` ( echo $$ ; time ps 2>&1 ; date ) | cksum | cut -f1 -d" " ` ++ port=1`expr 100 + \( $rand % 899 \)`$1 ++ [ $tries -gt 100 ] && echo Giving up, too many ports open && exit 1 ++ tries=`expr $tries + 1` ++ done + cat <<EOF >test-clamd.conf + LogFile `pwd`/clamd-test.log + LogFileMaxSize 0 |