Skip to content

Commit 8b48ef1

Browse files
committed
filesystem: mmap search not specific enough
The grep command that populates mmap_procs is too unspecific, and will return false positives from /usr or /etc if you attempt to manage mount points named /u or /e, respectively.
1 parent 15e3778 commit 8b48ef1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

heartbeat/Filesystem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ get_pids()
584584
fi
585585
elif [ "$FORCE_UNMOUNT" = "safe" ]; then
586586
procs=$(find /proc/[0-9]*/ -type l -lname "${dir}/*" -or -lname "${dir}" 2>/dev/null | awk -F/ '{print $3}')
587-
mmap_procs=$(grep " ${dir}" /proc/[0-9]*/maps | awk -F/ '{print $3}')
587+
mmap_procs=$(grep " ${dir}/" /proc/[0-9]*/maps | awk -F/ '{print $3}')
588588
printf "${procs}\n${mmap_procs}" | sort | uniq
589589
fi
590590
}

0 commit comments

Comments
 (0)