summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien "shaddai" Reveret2016-12-08 14:19:59 +0100
committerJulien "shaddai" Reveret2016-12-08 14:19:59 +0100
commite57429f89622968342e40e12d9ecb7e3babd22c3 (patch)
tree324a9f0c3732cc998fabd310cac288c3d44a3fc5
parentb5baef1ae6d847df0907162abe27cfdfe5395263 (diff)
fixing issue #40, no more double slash in output when scanning a whole directory
-rwxr-xr-xphp-malware-finder/phpmalwarefinder4
1 files changed, 3 insertions, 1 deletions
diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder
index a218a40..701564e 100755
--- a/php-malware-finder/phpmalwarefinder
+++ b/php-malware-finder/phpmalwarefinder
@@ -205,8 +205,10 @@ OPTS="${OPTS} -r ${CONFIG_PATH}${FORMAT}.yar"
205 205
206# Copy outpout to temporary file 206# Copy outpout to temporary file
207output=$(mktemp) 207output=$(mktemp)
208# delete trailing slash for directories to prevent double slash (issue #40)
209target=$(echo "$@" | sed s'#/$##')
208# Execute rules 210# Execute rules
209${NICE} ${NICE_OPTS} $YARA $OPTS "$@" |tee $output 211${NICE} ${NICE_OPTS} $YARA $OPTS "$target" |tee $output
210 212
211needle_in_haystack $output 213needle_in_haystack $output
212rm $output # comment this if you want to keep output 214rm $output # comment this if you want to keep output