autofs/SOURCES/autofs-5.1.5-use-ignore-option-for-offset-mounts-as-well.patch
2021-09-09 14:55:10 +00:00

45 lines
1.2 KiB
Diff

autofs-5.1.5 - use ignore option for offset mounts as well
From: Ian Kent <raven@themaw.net>
The pseudo option "ignore" (that's used as a hint that applications
should ignore this mount when reporting a list of mounts) has been
added to direct and indirect mounts but hasn't been added to offset
mounts.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
daemon/direct.c | 10 ++++++++++
2 files changed, 11 insertions(+)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -61,6 +61,7 @@ xx/xx/2018 autofs-5.1.5
- fix amd entry memory leak.
- fix unlink_mount_tree() not umounting mounts.
- add ignore mount option.
+- use ignore option for offset mounts as well.
19/12/2017 autofs-5.1.4
- fix spec file url.
--- autofs-5.1.4.orig/daemon/direct.c
+++ autofs-5.1.4/daemon/direct.c
@@ -756,6 +756,16 @@ int mount_autofs_offset(struct autofs_po
mp->options = tmp;
}
}
+
+ if ((ap->flags & MOUNT_FLAG_IGNORE) &&
+ ((get_kver_major() == 5 && get_kver_minor() > 4) ||
+ (get_kver_major() > 5))) {
+ char *tmp = realloc(mp->options, strlen(mp->options) + 7);
+ if (tmp) {
+ strcat(tmp, ",ignore");
+ mp->options = tmp;
+ }
+ }
}
strcpy(mountpoint, root);