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

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