nfs-utils/nfs-utils-1.0.12-export-nosubtree.patch

84 lines
2.8 KiB
Diff

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