Fix /proc/mounts for autofs(5) mounts.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
trasz 2019-09-04 18:00:54 +00:00
parent 2d0ae02ba6
commit 798fb0eec9

View File

@ -462,6 +462,15 @@ linprocfs_domtab(PFS_FILL_ARGS)
else if (strcmp(fstype, "procfs") == 0)
continue;
if (strcmp(fstype, "autofs") == 0) {
/*
* FreeBSD uses eg "map -hosts", whereas Linux
* expects just "-hosts".
*/
if (strncmp(mntfrom, "map ", 4) == 0)
mntfrom += 4;
}
if (strcmp(fstype, "linsysfs") == 0) {
sbuf_printf(sb, "/sys %s sysfs %s", mntto,
sp->f_flags & MNT_RDONLY ? "ro" : "rw");