1
mirror of https://github.com/carlospolop/PEASS-ng synced 2025-03-28 18:33:05 +01:00

Merge pull request from DidierA/fix-infinite-loop

fix for infinite loop when sed does not support -E
This commit is contained in:
Carlos Polop 2021-01-14 10:26:03 +01:00 committed by GitHub
commit e41c819986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -263,7 +263,7 @@ SEDOVERFLOW=true
for grp in `groups $USER | cut -d ":" -f2`; do
wgroups="$wgroups -group $grp -or "
done
wgroups="`echo $wgroups | rev | cut -c5- | rev`"
wgroups="`echo $wgroups | sed -e 's/ -or$//'`"
while $SEDOVERFLOW; do
#WF=`find /dev /srv /proc /home /media /sys /lost+found /run /etc /root /var /tmp /mnt /boot /opt -type d -maxdepth $MAXPATH_FIND_W -writable -or -user $USER 2>/dev/null | sort`
#if [ "$MACPEAS" ]; then
@ -279,6 +279,9 @@ while $SEDOVERFLOW; do
else
MAXPATH_FIND_W=$(($MAXPATH_FIND_W-1)) #If overflow of directories, check again with MAXPATH_FIND_W - 1
fi
if [ $MAXPATH_FIND_W -lt 1 ] ; then # prevent infinite loop
SEDOVERFLOW=false
fi
done
notExtensions="\.tif$|\.tiff$|\.gif$|\.jpeg$|\.jpg|\.jif$|\.jfif$|\.jp2$|\.jpx$|\.j2k$|\.j2c$|\.fpx$|\.pcd$|\.png$|\.pdf$|\.flv$|\.mp4$|\.mp3$|\.gifv$|\.avi$|\.mov$|\.mpeg$|\.wav$|\.doc$|\.docx$|\.xls$|\.xlsx$|\.svg$"