X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fexport%2Fexport.c;h=edfe52faf3b54c06c998f06b99776cf50aaff4a0;hb=ab1d7b6062aba3bb5cf62325b37ee1e34b864c3f;hp=ba0d095eba5d1bf0c94cb52e4fba85ee545a2253;hpb=1898a9dc11a9834f557775a6b7d1ca7b1b6ca057;p=nfs-utils.git diff --git a/support/export/export.c b/support/export/export.c index ba0d095..edfe52f 100644 --- a/support/export/export.c +++ b/support/export/export.c @@ -129,7 +129,7 @@ export_add(nfs_export *exp) xlog(L_FATAL, "unknown client type in export_add"); epp = exportlist + type; - while (*epp && slen < strlen((*epp)->m_export.e_path)) + while (*epp && slen <= strlen((*epp)->m_export.e_path)) epp = &((*epp)->m_next); exp->m_next = *epp; *epp = exp; @@ -172,10 +172,9 @@ export_allowed_internal (struct hostent *hp, char *path) return NULL; } -struct exportent * +nfs_export * export_allowed(struct hostent *hp, char *path) { - static struct exportent ee; nfs_export *exp; char epath[MAXPATHLEN+1]; char *p = NULL; @@ -188,10 +187,8 @@ export_allowed(struct hostent *hp, char *path) /* Try the longest matching exported pathname. */ while (1) { exp = export_allowed_internal (hp, epath); - if (exp) { - dupexportent(&ee, &exp->m_export); - return ⅇ - } + if (exp) + return exp; /* We have to treat the root, "/", specially. */ if (p == &epath[1]) break; p = strrchr(epath, '/'); @@ -239,6 +236,8 @@ export_freeall(void) xfree(exp->m_export.e_squids); if (exp->m_export.e_sqgids) xfree(exp->m_export.e_sqgids); + if (exp->m_export.e_mountpoint) + free(exp->m_export.e_mountpoint); xfree(exp); } exportlist[i] = NULL;