+2001-12-20 NeilBrown <neilb@cse.unsw.edu.au>
+
+ * support/export/client.c (client_lookup): use strcasecmp when
+ comparing host names
+ * support/nfs/export.c (getexportent): add fromkernel arg and use
+ different defaults as kernels prior to 2.4.11 assume different
+ defaults in /proc/fs/nfs/exports
+ * support/include/nfslib.h, support/export/export.c,
+ support/export/xtab.c: support extra "fromkernel" arg for
+ getexportent.
+
2001-12-13 Chip Salzenberg <chip@pobox.com>
* debian/changelog: Version 0.3.3-5.
}
} else {
for (clp = clientlist[htype]; clp; clp = clp->m_next) {
- if (strcmp(hname, clp->m_hostname)==0)
+ if (strcasecmp(hname, clp->m_hostname)==0)
break;
}
}
nfs_export *exp;
setexportent(fname, "r");
- while ((eep = getexportent()) != NULL) {
+ while ((eep = getexportent(0)) != NULL) {
exp = export_lookup(eep->e_hostname, eep->e_path, 0);
if (!exp)
export_create(eep,0);
if ((lockid = xflock(xtab, "r")) < 0)
return 0;
setexportent(xtab, "r");
- while ((xp = getexportent()) != NULL) {
+ while ((xp = getexportent(is_export==0)) != NULL) {
if (!(exp = export_lookup(xp->e_hostname, xp->e_path, is_export != 1)) &&
!(exp = export_create(xp, is_export!=1))) {
continue;
* configuration file parsing
*/
void setexportent(char *fname, char *type);
-struct exportent * getexportent(void);
+struct exportent * getexportent(int);
void putexportent(struct exportent *xep);
void endexportent(void);
struct exportent * mkexportent(char *hname, char *path, char *opts);
}
struct exportent *
-getexportent(void)
+getexportent(int fromkernel)
{
static struct exportent ee;
char exp[512];
freesquash();
ee.e_flags = EXPORT_DEFAULT_FLAGS;
+ /* some kernels assume the default is sync rather than
+ * async. More recent kernels always report one or other,
+ * but this test makes sure we assume same as kernel
+ * Ditto for wgather
+ */
+ if (fromkernel) {
+ ee.e_flags &= ~NFSEXP_ASYNC;
+ ee.e_flags &= ~NFSEXP_GATHERED_WRITES;
+ }
ee.e_maptype = CLE_MAP_IDENT;
ee.e_anonuid = -2;
ee.e_anongid = -2;