summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
955d48d)
* support/include/exportfs.h (export_errno): New.
* support/nfs/exports.c: Include <errno.h>.
(export_errno): New.
(getexportent): Set export_errno to EINVAL for bad option.
(parseopts): Likewise.
Report the location of the default sync/async option.
* utils/exportfs/exportfs.c (main): Initialize export_errno to
0. Return export_errno.
+2002-10-11 H.J. Lu <hjl@lucon.org>
+
+ * support/include/exportfs.h (export_errno): New.
+
+ * support/nfs/exports.c: Include <errno.h>.
+ (export_errno): New.
+ (getexportent): Set export_errno to EINVAL for bad option.
+ (parseopts): Likewise.
+ Report the location of the default sync/async option.
+
+ * utils/exportfs/exportfs.c (main): Initialize export_errno to
+ 0. Return export_errno.
+
2002-10-11 Juan Gomez <gomez@cs.sjsu.edu>
NeilBrown <neilb@cse.unsw.edu.au>
2002-10-11 Juan Gomez <gomez@cs.sjsu.edu>
NeilBrown <neilb@cse.unsw.edu.au>
struct nfskey * key_lookup(char *hname);
struct nfskey * key_lookup(char *hname);
+/* Record export error. */
+extern int export_errno;
+
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include "nfslib.h"
#include "exportfs.h"
#include "xmalloc.h"
#include "nfslib.h"
#include "exportfs.h"
#include "xmalloc.h"
#define EXPORT_DEFAULT_FLAGS \
(NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES)
#define EXPORT_DEFAULT_FLAGS \
(NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES)
static char *efname = NULL;
static XFILE *efp = NULL;
static int first;
static char *efname = NULL;
static XFILE *efp = NULL;
static int first;
}
if (ok < 0) {
xlog(L_ERROR, "expected client(options...)");
}
if (ok < 0) {
xlog(L_ERROR, "expected client(options...)");
return NULL;
}
first = 0;
return NULL;
}
first = 0;
*opt++ = '\0';
if (!(sp = strchr(opt, ')')) || sp[1] != '\0') {
syntaxerr("bad option list");
*opt++ = '\0';
if (!(sp = strchr(opt, ')')) || sp[1] != '\0') {
syntaxerr("bad option list");
return NULL;
}
*sp = '\0';
return NULL;
}
*sp = '\0';
}
if (strlen(exp) >= sizeof(ee.e_hostname)) {
syntaxerr("client name too long");
}
if (strlen(exp) >= sizeof(ee.e_hostname)) {
syntaxerr("client name too long");
return NULL;
}
strncpy(ee.e_hostname, exp, sizeof (ee.e_hostname) - 1);
return NULL;
}
strncpy(ee.e_hostname, exp, sizeof (ee.e_hostname) - 1);
if (opt[8]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad anonuid \"%s\"\n",
flname, flline, opt);
if (opt[8]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad anonuid \"%s\"\n",
flname, flline, opt);
return -1;
}
} else if (strncmp(opt, "anongid=", 8) == 0) {
return -1;
}
} else if (strncmp(opt, "anongid=", 8) == 0) {
if (opt[8]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad anongid \"%s\"\n",
flname, flline, opt);
if (opt[8]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad anongid \"%s\"\n",
flname, flline, opt);
- free(opt);
- return -1;
}
} else if (strncmp(opt, "squash_uids=", 12) == 0) {
if (parsesquash(opt+12, &squids, &nsquids, &cp) < 0) {
}
} else if (strncmp(opt, "squash_uids=", 12) == 0) {
if (parsesquash(opt+12, &squids, &nsquids, &cp) < 0) {
- free(opt);
- return -1;
}
} else if (strncmp(opt, "squash_gids=", 12) == 0) {
if (parsesquash(opt+12, &sqgids, &nsqgids, &cp) < 0) {
}
} else if (strncmp(opt, "squash_gids=", 12) == 0) {
if (parsesquash(opt+12, &sqgids, &nsqgids, &cp) < 0) {
- free(opt);
- return -1;
}
} else if (strncmp(opt, "fsid=", 5) == 0) {
char *oe;
}
} else if (strncmp(opt, "fsid=", 5) == 0) {
char *oe;
if (opt[5]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad fsid \"%s\"\n",
flname, flline, opt);
if (opt[5]=='\0' || *oe != '\0') {
xlog(L_ERROR, "%s: %d: bad fsid \"%s\"\n",
flname, flline, opt);
- free(opt);
- return -1;
}
ep->e_flags |= NFSEXP_FSID;
} else {
xlog(L_ERROR, "%s:%d: unknown keyword \"%s\"\n",
flname, flline, opt);
ep->e_flags |= NFSEXP_ALLSQUASH | NFSEXP_READONLY;
}
ep->e_flags |= NFSEXP_FSID;
} else {
xlog(L_ERROR, "%s:%d: unknown keyword \"%s\"\n",
flname, flline, opt);
ep->e_flags |= NFSEXP_ALLSQUASH | NFSEXP_READONLY;
- free(opt);
- return -1;
}
free(opt);
while (isblank(*cp))
}
free(opt);
while (isblank(*cp))
out:
if (warn && !had_sync_opt)
out:
if (warn && !had_sync_opt)
- xlog(L_WARNING, "No 'sync' or 'async' option specified for export \"%s:%s\".\n"
+ xlog(L_WARNING, "%s [%d]: 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",
" Assuming default behaviour ('sync').\n"
" NOTE: this default has changed from previous versions\n",
ep->e_hostname, ep->e_path);
return 1;
ep->e_hostname, ep->e_path);
return 1;
while ((c = getopt(argc, argv, "aio:ruv")) != EOF) {
switch(c) {
case 'a':
while ((c = getopt(argc, argv, "aio:ruv")) != EOF) {
switch(c) {
case 'a':
xtab_export_write();
xtab_mount_write();
xtab_export_write();
xtab_mount_write();
}
/* we synchronise intention with reality.
}
/* we synchronise intention with reality.