|
|
c8d72b |
autofs-5.1.5 - add ignore mount option
|
|
|
c8d72b |
|
|
|
c8d72b |
From: Ian Kent <raven@themaw.net>
|
|
|
c8d72b |
|
|
|
c8d72b |
Add mount option "ignore", if the kernel supports it, as an
|
|
|
c8d72b |
indicator to applications to ignore the mount entry.
|
|
|
c8d72b |
|
|
|
c8d72b |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
c8d72b |
---
|
|
|
c8d72b |
CHANGELOG | 1 +
|
|
|
c8d72b |
daemon/direct.c | 10 ++++++++++
|
|
|
c8d72b |
daemon/indirect.c | 10 ++++++++++
|
|
|
c8d72b |
include/automount.h | 3 +++
|
|
|
c8d72b |
lib/master.c | 4 ++--
|
|
|
c8d72b |
5 files changed, 26 insertions(+), 2 deletions(-)
|
|
|
c8d72b |
|
|
|
c8d72b |
--- autofs-5.0.7.orig/daemon/direct.c
|
|
|
c8d72b |
+++ autofs-5.0.7/daemon/direct.c
|
|
|
c8d72b |
@@ -423,6 +423,16 @@ int do_mount_autofs_direct(struct autofs
|
|
|
c8d72b |
mp->options = tmp;
|
|
|
c8d72b |
}
|
|
|
c8d72b |
}
|
|
|
c8d72b |
+
|
|
|
c8d72b |
+ if ((ap->flags & MOUNT_FLAG_IGNORE) &&
|
|
|
c8d72b |
+ ((get_kver_major() == 5 && get_kver_minor() > 4) ||
|
|
|
c8d72b |
+ (get_kver_major() > 5))) {
|
|
|
c8d72b |
+ char *tmp = realloc(mp->options, strlen(mp->options) + 7);
|
|
|
c8d72b |
+ if (tmp) {
|
|
|
c8d72b |
+ strcat(tmp, ",ignore");
|
|
|
c8d72b |
+ mp->options = tmp;
|
|
|
c8d72b |
+ }
|
|
|
c8d72b |
+ }
|
|
|
c8d72b |
}
|
|
|
c8d72b |
|
|
|
c8d72b |
/* In case the directory doesn't exist, try to mkdir it */
|
|
|
c8d72b |
--- autofs-5.0.7.orig/daemon/indirect.c
|
|
|
c8d72b |
+++ autofs-5.0.7/daemon/indirect.c
|
|
|
c8d72b |
@@ -132,6 +132,16 @@ static int do_mount_autofs_indirect(stru
|
|
|
c8d72b |
}
|
|
|
c8d72b |
}
|
|
|
c8d72b |
|
|
|
c8d72b |
+ if ((ap->flags & MOUNT_FLAG_IGNORE) &&
|
|
|
c8d72b |
+ ((get_kver_major() == 5 && get_kver_minor() > 4) ||
|
|
|
c8d72b |
+ (get_kver_major() > 5))) {
|
|
|
c8d72b |
+ char *tmp = realloc(options, strlen(options) + 7);
|
|
|
c8d72b |
+ if (tmp) {
|
|
|
c8d72b |
+ strcat(tmp, ",ignore");
|
|
|
c8d72b |
+ options = tmp;
|
|
|
c8d72b |
+ }
|
|
|
c8d72b |
+ }
|
|
|
c8d72b |
+
|
|
|
c8d72b |
/* In case the directory doesn't exist, try to mkdir it */
|
|
|
c8d72b |
if (mkdir_path(root, 0555) < 0) {
|
|
|
c8d72b |
if (errno != EEXIST && errno != EROFS) {
|
|
|
c8d72b |
--- autofs-5.0.7.orig/include/automount.h
|
|
|
c8d72b |
+++ autofs-5.0.7/include/automount.h
|
|
|
c8d72b |
@@ -541,6 +541,9 @@ struct kernel_mod_version {
|
|
|
c8d72b |
/* Use strict expire semantics if requested and kernel supports it */
|
|
|
c8d72b |
#define MOUNT_FLAG_STRICTEXPIRE 0x0400
|
|
|
c8d72b |
|
|
|
c8d72b |
+/* Indicator for applications to ignore the mount entry */
|
|
|
c8d72b |
+#define MOUNT_FLAG_IGNORE 0x0800
|
|
|
c8d72b |
+
|
|
|
c8d72b |
struct autofs_point {
|
|
|
c8d72b |
pthread_t thid;
|
|
|
c8d72b |
char *path; /* Mount point name */
|
|
|
c8d72b |
--- autofs-5.0.7.orig/lib/master.c
|
|
|
c8d72b |
+++ autofs-5.0.7/lib/master.c
|
|
|
c8d72b |
@@ -101,9 +101,9 @@ int master_add_autofs_point(struct maste
|
|
|
c8d72b |
ap->negative_timeout = global_negative_timeout;
|
|
|
c8d72b |
ap->exp_timeout = defaults_get_timeout();
|
|
|
c8d72b |
ap->exp_runfreq = 0;
|
|
|
c8d72b |
- ap->flags = 0;
|
|
|
c8d72b |
+ ap->flags = MOUNT_FLAG_IGNORE;
|
|
|
c8d72b |
if (ghost)
|
|
|
c8d72b |
- ap->flags = MOUNT_FLAG_GHOST;
|
|
|
c8d72b |
+ ap->flags |= MOUNT_FLAG_GHOST;
|
|
|
c8d72b |
|
|
|
c8d72b |
if (nobind)
|
|
|
c8d72b |
ap->flags |= MOUNT_FLAG_NOBIND;
|
|
|
c8d72b |
--- autofs-5.0.7.orig/CHANGELOG
|
|
|
c8d72b |
+++ autofs-5.0.7/CHANGELOG
|
|
|
c8d72b |
@@ -334,6 +334,7 @@
|
|
|
c8d72b |
- remove a couple of old debug messages.
|
|
|
c8d72b |
- fix amd entry memory leak.
|
|
|
c8d72b |
- fix unlink_mount_tree() not umounting mounts.
|
|
|
c8d72b |
+- add ignore mount option.
|
|
|
c8d72b |
|
|
|
c8d72b |
25/07/2012 autofs-5.0.7
|
|
|
c8d72b |
=======================
|