diff options
| author | Sebastien Blot | 2016-02-05 17:43:17 +0100 |
|---|---|---|
| committer | Sebastien Blot | 2016-02-05 17:43:17 +0100 |
| commit | ec36f09e923f9f4b396a116ddcfc5cd8d6382367 (patch) | |
| tree | 27ff2a0301454856cc9801d25a3760ceb0c29f8b | |
| parent | 2b79a67fcc6d07ef6f439c2d8ae55171b3af8256 (diff) | |
handle filenames with spaces
| -rwxr-xr-x | php-malware-finder/phpmalwarefinder | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder index 49cf8ce..98c578d 100755 --- a/php-malware-finder/phpmalwarefinder +++ b/php-malware-finder/phpmalwarefinder | |||
| @@ -31,11 +31,11 @@ fi | |||
| 31 | # before starting yara, check if the file | 31 | # before starting yara, check if the file |
| 32 | one_line_trick() { | 32 | one_line_trick() { |
| 33 | 33 | ||
| 34 | for file in $(find $@ -type f); do | 34 | find $@ -type f -print0 | while IFS= read -r -d '' -r file; do |
| 35 | line_num=$(wc -l $file | cut -d' ' -f1) | 35 | line_num=$(wc -l "$file" | cut -d' ' -f1) |
| 36 | char_num=$(wc -c $file | cut -d' ' -f1) | 36 | char_num=$(wc -c "$file" | cut -d' ' -f1) |
| 37 | 37 | ||
| 38 | if [ "$line_num" -le "2" ]; then | 38 | if [ "$line_num" -le "2" ]; then |
| 39 | # humm, 2 lines long file ? | 39 | # humm, 2 lines long file ? |
| 40 | if [ "$char_num" -ge "300" ]; then | 40 | if [ "$char_num" -ge "300" ]; then |
| 41 | echo TooShort $file | 41 | echo TooShort $file |
