Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147026815
D51412.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D51412.id.diff
View Options
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -313,6 +313,8 @@
# redirected to another source file.
man_check_for_so() {
local IFS line tstr
+ local counter_so=0
+ local counter_so_limit=32
unset IFS
if [ -n "$catpage" ]; then
@@ -320,13 +322,16 @@
fi
# We need to loop to accommodate multiple .so directives.
- while true
+ while [ $counter_so -lt $counter_so_limit ]
do
+ counter_so=$((counter_so + 1))
+
line=$($cattool "$manpage" 2>/dev/null | grep -E -m1 -v '^\.\\"[ ]*|^[ ]*$')
case "$line" in
'.so /'*) break ;; # ignore absolute path
'.so '*) trim "${line#.so}"
- decho "$manpage includes $tstr"
+ decho "$manpage includes $tstri level=$counter_so"
+
# Glob and check for the file.
if ! check_man "$1/$tstr" ""; then
decho " Unable to find $tstr"
@@ -337,6 +342,10 @@
esac
done
+ if [ $counter_so -ge $counter_so_limit ]; then
+ decho ".so include limit of $counter_so_limit reached, stop"
+ fi
+
return 0
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 5:40 PM (8 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29398339
Default Alt Text
D51412.id.diff (1 KB)
Attached To
Mode
D51412: man(1): avoid endless loop in .so includes
Attached
Detach File
Event Timeline
Log In to Comment