Permalink
Browse files

Merge pull request #66 from Sinkmanu/fix-duplicates-and-symlink

Fix duplicate path when use --dir and follow symbolic directories
  • Loading branch information...
slimm609 committed Jul 29, 2018
2 parents a1e7b60 + 2453fa3 commit be09175564ba4245e51eb5f7bcf7e0c594cc6067
Showing with 5 additions and 5 deletions.
  1. +5 −5 checksec
View
@@ -1266,19 +1266,19 @@ do
fdircount=0
fdirtotal=0
for N in $(find $tempdir -type f); do
for N in $(find -L $tempdir -type f); do
if [[ "$N" != "[A-Za-z1-0]*" ]]; then
out=$(file "$N" 2>/dev/null)
if [[ $out =~ ELF ]] ; then
(( fdirtotal++ ))
fi
fi
done
for N in $(find $tempdir -type f); do
for N in $(find -L $tempdir -type f); do
if [[ "$N" != "[A-Za-z1-0]*" ]]; then
# read permissions?
if [[ ! -r "$N" ]]; then
printf "\033[31mError: No read permissions for '%s/%s' (run as root).\033[m\n" "$tempdir" "$N"
printf "\033[31mError: No read permissions for '%s' (run as root).\033[m\n" "$N"
else
# ELF executable?
out=$(file "$(readlink -f "$N")")
@@ -1293,9 +1293,9 @@ do
echo_message "" "" " " ""
filecheck "$N"
if [[ "$(find "$N" \( -perm -004000 -o -perm -002000 \) -type f -print)" ]]; then
echo_message "\033[37;41m$2$N\033[m\n" ",$2$N\n" " filename='$2$N' />\n" ",\"filename\":\"$2$N\"}"
echo_message "\033[37;41m$N\033[m\n" ",$N\n" " filename='$N' />\n" ",\"filename\":\"$N\"}"
else
echo_message "$tempdir/$N\n" ",$tempdir/$N\n" " filename='$tempdir/$N' />\n" ",\"filename\":\"$tempdir/$N\"}"
echo_message "$N\n" ",$N\n" " filename='$N' />\n" ",\"filename\":\"$N\"}"
fi
if [[ "$fdircount" == "$fdirtotal" ]]; then
echo_message "" "" "" ""

0 comments on commit be09175

Please sign in to comment.