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

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