walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
bf13fea
--- nfs-utils-1.0.12/support/nfs/exports.c.orig	2007-02-26 23:55:40.000000000 -0500
bf13fea
+++ nfs-utils-1.0.12/support/nfs/exports.c	2007-03-09 12:25:37.000000000 -0500
bf13fea
@@ -32,7 +32,8 @@
bf13fea
 #include "xio.h"
bf13fea
 
bf13fea
 #define EXPORT_DEFAULT_FLAGS	\
bf13fea
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES)
bf13fea
+  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|\
bf13fea
+  NFSEXP_NOSUBTREECHECK)
bf13fea
 
bf13fea
 int export_errno;
bf13fea
 
bf13fea
@@ -45,7 +46,7 @@ static int	*squids = NULL, nsquids = 0,
bf13fea
 
bf13fea
 static int	getexport(char *exp, int len);
bf13fea
 static int	getpath(char *path, int len);
bf13fea
-static int	parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr);
bf13fea
+static int	parseopts(char *cp, struct exportent *ep);
bf13fea
 static int	parsesquash(char *list, int **idp, int *lenp, char **ep);
bf13fea
 static int	parsenum(char **cpp);
bf13fea
 static int	parsemaptype(char *type);
bf13fea
@@ -122,7 +123,7 @@ getexportent(int fromkernel, int fromexp
bf13fea
 		
bf13fea
 	/* Check for default options */
bf13fea
 	if (exp[0] == '-') {
bf13fea
-		if (parseopts(exp + 1, &def_ee, 0, &has_default_subtree_opts) < 0)
bf13fea
+		if (parseopts(exp + 1, &def_ee) < 0)
bf13fea
 			return NULL;
bf13fea
 		
bf13fea
 		has_default_opts = 1;
bf13fea
@@ -166,7 +167,7 @@ getexportent(int fromkernel, int fromexp
bf13fea
 	strncpy(ee.e_hostname, hostname, sizeof (ee.e_hostname) - 1);
bf13fea
 	ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0';
bf13fea
 
bf13fea
-	if (parseopts(opt, &ee, fromexports && !has_default_subtree_opts, NULL) < 0)
bf13fea
+	if (parseopts(opt, &ee) < 0)
bf13fea
 		return NULL;
bf13fea
 
bf13fea
 	/* resolve symlinks */
bf13fea
@@ -343,7 +344,7 @@ mkexportent(char *hname, char *path, cha
bf13fea
 	ee.e_path[sizeof (ee.e_path) - 1] = '\0';
bf13fea
 	strncpy (ee.m_path, ee.e_path, sizeof (ee.m_path) - 1);
bf13fea
 	ee.m_path [sizeof (ee.m_path) - 1] = '\0';
bf13fea
-	if (parseopts(options, &ee, 0, NULL) < 0)
bf13fea
+	if (parseopts(options, &ee) < 0)
bf13fea
 		return NULL;
bf13fea
 	return ⅇ
bf13fea
 }
bf13fea
@@ -351,7 +352,7 @@ mkexportent(char *hname, char *path, cha
bf13fea
 int
bf13fea
 updateexportent(struct exportent *eep, char *options)
bf13fea
 {
bf13fea
-	if (parseopts(options, eep, 0, NULL) < 0)
bf13fea
+	if (parseopts(options, eep) < 0)
bf13fea
 		return 0;
bf13fea
 	return 1;
bf13fea
 }
bf13fea
@@ -371,7 +372,7 @@ static int valid_uuid(char *uuid)
bf13fea
  * Parse option string pointed to by cp and set mount options accordingly.
bf13fea
  */
bf13fea
 static int
bf13fea
-parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
bf13fea
+parseopts(char *cp, struct exportent *ep)
bf13fea
 {
bf13fea
 	int	had_subtree_opt = 0;
bf13fea
 	char 	*flname = efname?efname:"command line";
bf13fea
@@ -539,16 +540,6 @@ bad_option:
bf13fea
 	ep->e_nsqgids = nsqgids;
bf13fea
 
bf13fea
 out:
bf13fea
-	if (warn && !had_subtree_opt)
bf13fea
-		xlog(L_WARNING, "%s [%d]: Neither 'subtree_check' or 'no_subtree_check' specified for export \"%s:%s\".\n"
bf13fea
-				"  Assuming default behaviour ('subtree_check').\n"
bf13fea
-		     		"  NOTE: this default will change with nfs-utils version 1.1.0\n",
bf13fea
-
bf13fea
-				flname, flline,
bf13fea
-				ep->e_hostname, ep->e_path);
bf13fea
-	if (had_subtree_opt_ptr)
bf13fea
-		*had_subtree_opt_ptr = had_subtree_opt;
bf13fea
-
bf13fea
 	return 1;
bf13fea
 }
bf13fea