Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 211

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.1 - use intr option as hosts mount default

From: Ian Kent <raven@themaw.net>

Use the "intr" option as default mount option for the hosts map
unless explicily overridden.
---

 man/auto.master.5.in |    5 +++--
 modules/parse_sun.c  |   11 +++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)


--- autofs-5.0.1.orig/man/auto.master.5.in
+++ autofs-5.0.1/man/auto.master.5.in
@@ -203,8 +203,9 @@ For example, with an entry in the master
 accessing /net/myserver will mount exports from myserver on directories below
 /net/myserver.
 .P
-NOTE: mounts done from a hosts map will be mounted with the "nosuid" and "nodev" options
-unless the options "suid" and "dev" are explicitly given in the master map entry.
+NOTE: mounts done from a hosts map will be mounted with the "nosuid,nodev,intr" options
+unless overridden by explicily specifying the "suid", "dev" or "nointr" options in the
+master map entry.
 .SH LDAP MAPS
 If the map type \fBldap\fP is specified the mapname is of the form
 \fB[//servername/]dn\fP, where the optional \fBservername\fP is
--- autofs-5.0.1.orig/modules/parse_sun.c
+++ autofs-5.0.1/modules/parse_sun.c
@@ -599,9 +599,10 @@ static int sun_mount(struct autofs_point
 			int len = strlen(options);
 			int suid = strstr(options, "suid") ? 0 : 7;
 			int dev = strstr(options, "dev") ? 0 : 6;
+			int nointr = strstr(options, "nointr") ? 0 : 5;
 
-			if (suid || dev) {
-				char *tmp = alloca(len + suid + dev + 1);
+			if (suid || dev || nointr) {
+				char *tmp = alloca(len + suid + dev + nointr + 1);
 				if (!tmp) {
 					error(ap->logopt, MODPREFIX
 					      "alloca failed for options");
@@ -615,10 +616,12 @@ static int sun_mount(struct autofs_point
 					strcat(tmp, ",nosuid");
 				if (dev)
 					strcat(tmp, ",nodev");
+				if (nointr)
+					strcat(tmp, ",intr");
 				options = tmp;
 			}
 		} else {
-			char *tmp = alloca(13);
+			char *tmp = alloca(18);
 			if (!tmp) {
 				error(ap->logopt,
 				      MODPREFIX "alloca failed for options");
@@ -626,7 +629,7 @@ static int sun_mount(struct autofs_point
 					return -1;
 				return 1;
 			}
-			strcpy(tmp, "nosuid,nodev");
+			strcpy(tmp, "nosuid,nodev,intr");
 			options = tmp;
 		}
 	}