Blame SOURCES/autofs-5.1.5-add-config-option-for-ignore-mount-option.patch

306fa1
autofs-5.1.5 - add config option for "ignore" mount option
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Add a configuration option to control whether the autofs pseudo
306fa1
mount option is used on autofs mounts.
306fa1
306fa1
The default setting is "no" to avoid unexpected behaviour and
306fa1
so is an opt-in setting for those who understand that, if user
306fa1
space utilities and libraries honour this, then autofs mounts
306fa1
will be ommitted from mount table listings.
306fa1
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 CHANGELOG                      |    1 +
306fa1
 include/defaults.h             |    2 ++
306fa1
 lib/defaults.c                 |   17 +++++++++++++++++
306fa1
 lib/master.c                   |    3 ++-
306fa1
 man/autofs.conf.5.in           |    7 +++++++
306fa1
 redhat/autofs.conf.default.in  |    9 +++++++++
306fa1
 samples/autofs.conf.default.in |    9 +++++++++
306fa1
 7 files changed, 47 insertions(+), 1 deletion(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -336,6 +336,7 @@
306fa1
 - fix unlink_mount_tree() not umounting mounts.
306fa1
 - add ignore mount option.
306fa1
 - use ignore option for offset mounts as well.
306fa1
+- add config option for "ignore" mount option
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/include/defaults.h
306fa1
+++ autofs-5.0.7/include/defaults.h
306fa1
@@ -51,6 +51,7 @@
306fa1
 
306fa1
 #define DEFAULT_USE_HOSTNAME_FOR_MOUNTS  "0"
306fa1
 #define DEFAULT_DISABLE_NOT_FOUND_MESSAGE "0"
306fa1
+#define DEFAULT_USE_IGNORE_MOUNT_OPTION	 "0"
306fa1
 
306fa1
 #define DEFAULT_SSS_MASTER_MAP_WAIT	"0"
306fa1
 #define DEFAULT_USE_MOUNT_REQUEST_LOG_ID "0"
306fa1
@@ -174,6 +175,7 @@ const char *defaults_get_auth_conf_file(
306fa1
 unsigned int defaults_get_map_hash_table_size(void);
306fa1
 unsigned int defaults_use_hostname_for_mounts(void);
306fa1
 unsigned int defaults_disable_not_found_message(void);
306fa1
+unsigned int defaults_get_use_ignore_mount_option(void);
306fa1
 unsigned int defaults_get_sss_master_map_wait(void);
306fa1
 unsigned int defaults_get_use_mount_request_log_id(void);
306fa1
 
306fa1
--- autofs-5.0.7.orig/lib/defaults.c
306fa1
+++ autofs-5.0.7/lib/defaults.c
306fa1
@@ -76,6 +76,7 @@
306fa1
 
306fa1
 #define NAME_USE_HOSTNAME_FOR_MOUNTS	"use_hostname_for_mounts"
306fa1
 #define NAME_DISABLE_NOT_FOUND_MESSAGE	"disable_not_found_message"
306fa1
+#define NAME_USE_IGNORE_MOUNT_OPTION	"use_ignore_mount_option"
306fa1
 
306fa1
 #define NAME_SSS_MASTER_MAP_WAIT	"sss_master_map_wait"
306fa1
 #define NAME_USE_MOUNT_REQUEST_LOG_ID	"use_mount_request_log_id"
306fa1
@@ -363,6 +364,11 @@ static int conf_load_autofs_defaults(voi
306fa1
 	if (ret == CFG_FAIL)
306fa1
 		goto error;
306fa1
 
306fa1
+	ret = conf_update(sec, NAME_USE_IGNORE_MOUNT_OPTION,
306fa1
+			  DEFAULT_USE_IGNORE_MOUNT_OPTION, CONF_ENV);
306fa1
+	if (ret == CFG_FAIL)
306fa1
+		goto error;
306fa1
+
306fa1
 	ret = conf_update(sec, NAME_SSS_MASTER_MAP_WAIT,
306fa1
 			  DEFAULT_SSS_MASTER_MAP_WAIT, CONF_ENV);
306fa1
 	if (ret == CFG_FAIL)
306fa1
@@ -1873,6 +1879,17 @@ unsigned int defaults_get_use_mount_requ
306fa1
 
306fa1
 	return res;
306fa1
 }
306fa1
+
306fa1
+unsigned int defaults_get_use_ignore_mount_option(void)
306fa1
+{
306fa1
+	int res;
306fa1
+
306fa1
+	res = conf_get_yesno(autofs_gbl_sec, NAME_USE_IGNORE_MOUNT_OPTION);
306fa1
+	if (res < 0)
306fa1
+		res = atoi(DEFAULT_USE_IGNORE_MOUNT_OPTION);
306fa1
+
306fa1
+	return res;
306fa1
+}
306fa1
 
306fa1
 unsigned int defaults_get_sss_master_map_wait(void)
306fa1
 {
306fa1
--- autofs-5.0.7.orig/lib/master.c
306fa1
+++ autofs-5.0.7/lib/master.c
306fa1
@@ -101,7 +101,8 @@ int master_add_autofs_point(struct maste
306fa1
 		ap->negative_timeout = global_negative_timeout;
306fa1
 	ap->exp_timeout = defaults_get_timeout();
306fa1
 	ap->exp_runfreq = 0;
306fa1
-	ap->flags = MOUNT_FLAG_IGNORE;
306fa1
+	if (defaults_get_use_ignore_mount_option())
306fa1
+		ap->flags = MOUNT_FLAG_IGNORE;
306fa1
 	if (ghost)
306fa1
 		ap->flags |= MOUNT_FLAG_GHOST;
306fa1
 
306fa1
--- autofs-5.0.7.orig/man/autofs.conf.5.in
306fa1
+++ autofs-5.0.7/man/autofs.conf.5.in
306fa1
@@ -151,6 +151,13 @@ That produces, IMHO, unnecessary noise i
306fa1
 has been added to provide the ability to turn it off. The default is "no"
306fa1
 to maintain the current behaviour.
306fa1
 .TP
306fa1
+.B use_ignore_mount_option
306fa1
+.br
306fa1
+An option to enable the use of autofs pseudo option "disable". This option
306fa1
+is used as a hint to user space that the mount entry should be ommitted from
306fa1
+mount table listings. The default is "no" to avoid unexpected changes in
306fa1
+behaviour and so is an opt-in setting.
306fa1
+.TP
306fa1
 .B sss_master_map_wait
306fa1
 .br
306fa1
 Set the time to wait and retry if sssd returns "no such entry" when starting
306fa1
--- autofs-5.0.7.orig/redhat/autofs.conf.default.in
306fa1
+++ autofs-5.0.7/redhat/autofs.conf.default.in
306fa1
@@ -183,6 +183,15 @@ mount_nfs_default_protocol = 4
306fa1
 #
306fa1
 #disable_not_found_message = "no"
306fa1
 #
306fa1
+# use_ignore_mount_option - This option is used to enable the use of autofs
306fa1
+#			pseudo option "disable". This option is used as a
306fa1
+#			hint to user space that the mount entry should be
306fa1
+#			ommitted from mount table listings. The default is
306fa1
+#			"no" to avoid unexpected changes in behaviour and
306fa1
+#			so is an opt-in setting.
306fa1
+#
306fa1
+#use_ignore_mount_option = no
306fa1
+#
306fa1
 # sss_master_map_wait - When sssd is starting up it can sometimes return
306fa1
 # 			"no such entry" for a short time until it has read
306fa1
 # 			in the LDAP map information. Internal default is 0
306fa1
--- autofs-5.0.7.orig/samples/autofs.conf.default.in
306fa1
+++ autofs-5.0.7/samples/autofs.conf.default.in
306fa1
@@ -182,6 +182,15 @@ browse_mode = no
306fa1
 #
306fa1
 #disable_not_found_message = "no"
306fa1
 #
306fa1
+# use_ignore_mount_option - This option is used to enable the use of autofs
306fa1
+#			pseudo option "disable". This option is used as a
306fa1
+#			hint to user space that the mount entry should be
306fa1
+#			ommitted from mount table listings. The default is
306fa1
+#			"no" to avoid unexpected changes in behaviour and
306fa1
+#			so is an opt-in setting.
306fa1
+#
306fa1
+#use_ignore_mount_option = no
306fa1
+#
306fa1
 # sss_master_map_wait - When sssd is starting up it can sometimes return
306fa1
 #			"no such entry" for a short time until it has read
306fa1
 # 			in the LDAP map information. Internal default is 0