Quotas applied to incorrect partition when fstab contains space after mount point

I moved my /home to a seperate partition but virtualmin still applied quotas to the root filesystem.

The problem turned out to be that the mount_point function in virtual-server-lib-funcs.pl compares the mount point from mtab(@mounted) to the mount point from fstab(@mounts) in this line:

local ($m2) = grep { $_->[0] eq $m->[0] } @mounts;

My fstab line was: UUID=ABCDEFG[tab][tab]/home[space][tab][...]

@mounts contained '/home[space]' as the mountpoint while @mounted contained '/home', so the line above didn't find /home.

After removing the additional space from fstab it worked fine.

It's probably a good idea to strip spaces from the mount points in @mounts before the comparison, because this took me hours to find ;)



Yes, Webmin & Virtualmin expect that either only tabs or only spaces be used to separate entries in the /etc/fstab file. This is un-avoidable because mount points, devices and remote paths can contain spaces, so just splitting up the line based on tabs or spaces will not work :-(