Do not update mtab if it is a symbolic link

Reported-by: <junkmailnotread@yahoo.com>
X-Gentoo-Bug: 370037
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=370037
This commit is contained in:
William Hubbs 2011-08-20 12:38:05 -05:00
parent 0c8bea2152
commit 2330978300

View File

@ -12,10 +12,9 @@ depend()
start() start()
{ {
# /etc/mtab could be a symlink to a location in /proc if [ -l /etc/mtab ]
if readlink -f /etc/mtab | grep -sq '^/proc/\(self\|[0-9]\+\)/mounts$'
then then
einfo "Skipping mtab update (link points to location in /proc)" einfo "Skipping mtab update (mtab is a symbolic link)"
return 0 return 0
fi fi