From 05b4bf92a2118fba8dd8eda30060def48985b40c Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 14 Jul 2015 10:07:01 +0200 Subject: added usage of nice when ionice is not available On some platforms (e.g. NetBSD, OS X), ionice is not available. This patch enables a fallback to nice. If neither ionice or nice are installed, an error message is displayed.--- phpmalwarefinder | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/phpmalwarefinder b/phpmalwarefinder index 0a85d85..15354d4 100755 --- a/phpmalwarefinder +++ b/phpmalwarefinder @@ -2,15 +2,29 @@ YARA=$(which yara) CONFIG_PATH='/etc/phpmalwarefinder/malwares.yara' +IONICE_BIN=$(which ionice) +NICE_BIN=$(which nice) if [ ! -f "$YARA" ] then - YARA='./yara' + YARA='./yara' fi if [ ! -f "$CONFIG_PATH" ] then - CONFIG_PATH='./malwares.yara' + CONFIG_PATH='./malwares.yara' +fi + +if [ -f "${IONICE_BIN}" ] +then + NICE=${IONICE_BIN} + NICE_OPTS="-c 3" +else + if [ -f "${NICE_BIN}" ] + then + NICE=${NICE_BIN} + NICE_OPTS="-n 20" + fi fi show_help() { @@ -59,12 +73,19 @@ then exit 1 fi +if [ ! -e ${NICE} ] +then + echo "no nice programe available. PLease install ionice or nice." + exit 1 +fi + if [ -z $@ ] then - show_help - exit 1 + show_help + exit 1 fi OPTS="${OPTS} -r ${CONFIG_PATH}" -ionice -c3 $YARA $OPTS $@ +${NICE} ${NICE_OPTS} $YARA $OPTS $@ + -- cgit v1.3 From 1cabf5d265cd4c4139cd679cc212d6ead845081a Mon Sep 17 00:00:00 2001 From: ahpnils Date: Fri, 28 Aug 2015 09:54:29 +0200 Subject: try to manually sync with upstream --- phpmalwarefinder | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/phpmalwarefinder b/phpmalwarefinder index 9c4daa4..1fbe4cf 100755 --- a/phpmalwarefinder +++ b/phpmalwarefinder @@ -7,24 +7,12 @@ NICE_BIN=$(which nice) if [ ! -f "$YARA" ] then - YARA='./yara' + YARA='./yara' fi if [ ! -f "$CONFIG_PATH" ] then - CONFIG_PATH='./malwares.yara' -fi - -if [ -f "${IONICE_BIN}" ] -then - NICE=${IONICE_BIN} - NICE_OPTS="-c 3" -else - if [ -f "${NICE_BIN}" ] - then - NICE=${NICE_BIN} - NICE_OPTS="-n 20" - fi + CONFIG_PATH='./malwares.yara' fi if [ -f "${IONICE_BIN}" ] @@ -85,16 +73,10 @@ then exit 1 fi -if [ ! -e ${NICE} ] -then - echo "no nice programe available. PLease install ionice or nice." - exit 1 -fi - if [ -z $@ ] then - show_help - exit 1 + show_help + exit 1 fi if [ ! -e ${NICE} ] -- cgit v1.3 From 3a34bbb3d0b45a1e75e59f84761c0fc1a425a0ac Mon Sep 17 00:00:00 2001 From: ahpnils Date: Fri, 28 Aug 2015 14:06:14 +0200 Subject: Add whitelist for Dotclear 2.8.0 --- whitelist.yara | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whitelist.yara b/whitelist.yara index cadb7ab..858860d 100644 --- a/whitelist.yara +++ b/whitelist.yara @@ -84,6 +84,10 @@ private rule Concrete5 private rule Dotclear : Blog { condition: + /* dotclear 2.8.0 */ + hash.sha1(0, filesize) == "c732d2d54a80250fb8b51d4dddb74d05a59cee2e" or // inc/public/class.dc.template.php + hash.sha1(0, filesize) == "cc494f7f4044b5a3361281e27f2f7bb8952b8964" or // inc/core/class.dc.modules.php + /* dotclear 2.7.5 */ hash.sha1(0, filesize) == "192126b08c40c5ca086b5e4d7433e982f708baf3" or // inc/public/class.dc.template.php hash.sha1(0, filesize) == "51e6810ccd3773e2bd453e97ccf16059551bae08" or // inc/libs/clearbricks/common/lib.date.php -- cgit v1.3