From: neilbrown Date: Wed, 29 May 2002 06:06:31 +0000 (+0000) Subject: See Changelog X-Git-Tag: nfs-utils-1-0-1-pre8^0 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=1898a9dc11a9834f557775a6b7d1ca7b1b6ca057;p=nfs-utils.git See Changelog --- diff --git a/ChangeLog b/ChangeLog index 94f71dd..054b39e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-05-29 NeilBrown + + * let parseopts know if /etc/exports was being read or not, + and have it only print "no sync or async" warning in that case. + 2002-05-06 Tom McNeal NeilBrown diff --git a/support/export/export.c b/support/export/export.c index f95e729..ba0d095 100644 --- a/support/export/export.c +++ b/support/export/export.c @@ -32,7 +32,7 @@ export_read(char *fname) nfs_export *exp; setexportent(fname, "r"); - while ((eep = getexportent(0)) != NULL) { + while ((eep = getexportent(0,1)) != NULL) { exp = export_lookup(eep->e_hostname, eep->e_path, 0); if (!exp) export_create(eep,0); diff --git a/support/export/xtab.c b/support/export/xtab.c index 4daef00..3ef3661 100644 --- a/support/export/xtab.c +++ b/support/export/xtab.c @@ -32,7 +32,7 @@ xtab_read(char *xtab, int is_export) if ((lockid = xflock(xtab, "r")) < 0) return 0; setexportent(xtab, "r"); - while ((xp = getexportent(is_export==0)) != NULL) { + while ((xp = getexportent(is_export==0, 0)) != NULL) { if (!(exp = export_lookup(xp->e_hostname, xp->e_path, is_export != 1)) && !(exp = export_create(xp, is_export!=1))) { continue; diff --git a/support/include/nfslib.h b/support/include/nfslib.h index 57c703c..6bcc859 100644 --- a/support/include/nfslib.h +++ b/support/include/nfslib.h @@ -85,7 +85,7 @@ struct rmtabent { * configuration file parsing */ void setexportent(char *fname, char *type); -struct exportent * getexportent(int); +struct exportent * getexportent(int,int); void putexportent(struct exportent *xep); void endexportent(void); struct exportent * mkexportent(char *hname, char *path, char *opts); diff --git a/support/nfs/exports.c b/support/nfs/exports.c index ce49edc..3c5b198 100644 --- a/support/nfs/exports.c +++ b/support/nfs/exports.c @@ -39,7 +39,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); +static int parseopts(char *cp, struct exportent *ep, int warn); static int parsesquash(char *list, int **idp, int *lenp, char **ep); static int parsenum(char **cpp); static int parsemaptype(char *type); @@ -61,7 +61,7 @@ setexportent(char *fname, char *type) } struct exportent * -getexportent(int fromkernel) +getexportent(int fromkernel, int fromexports) { static struct exportent ee; char exp[512]; @@ -127,7 +127,7 @@ getexportent(int fromkernel) strncpy(ee.e_hostname, exp, sizeof (ee.e_hostname) - 1); ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0'; - if (parseopts(opt, &ee) < 0) + if (parseopts(opt, &ee, fromexports) < 0) return NULL; /* resolve symlinks */ @@ -269,7 +269,7 @@ mkexportent(char *hname, char *path, char *options) 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) + if (parseopts(options, &ee, 0) < 0) return NULL; return ⅇ } @@ -277,7 +277,7 @@ mkexportent(char *hname, char *path, char *options) int updateexportent(struct exportent *eep, char *options) { - if (parseopts(options, eep) < 0) + if (parseopts(options, eep, 0) < 0) return 0; return 1; } @@ -286,7 +286,7 @@ updateexportent(struct exportent *eep, char *options) * Parse option string pointed to by cp and set mount options accordingly. */ static int -parseopts(char *cp, struct exportent *ep) +parseopts(char *cp, struct exportent *ep, int warn) { int had_sync_opt = 0; char *flname = efname?efname:"command line"; @@ -420,7 +420,7 @@ parseopts(char *cp, struct exportent *ep) ep->e_nsqgids = nsqgids; out: - if (!had_sync_opt) + if (warn && !had_sync_opt) xlog(L_WARNING, "No 'sync' or 'async' option specified for export \"%s:%s\".\n" " Assuming default behaviour ('sync').\n" " NOTE: this default has changed from previous versions\n",