X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Fnfs%2Fexports.c;h=3c5b19881864249fa9910a070e720ab605fe8ce5;hp=ce49edc2e4f641dc3a1d4ac80c1a94a340810b45;hb=1898a9dc11a9834f557775a6b7d1ca7b1b6ca057;hpb=84efbd57c04964b0f7b6b65d9f83943baa14f22d 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",