X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fv4root.c;h=ac800b3dbc6d0826139e9db5e17950707663370e;hp=d890181b5f2fab86ce60c26978884aab25e624fb;hb=40af0d2957a168bee50337695379313f3f88c635;hpb=3b777b084a438f55482c8bf7508903ff4c30e1db diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c index d890181..ac800b3 100644 --- a/utils/mountd/v4root.c +++ b/utils/mountd/v4root.c @@ -147,7 +147,7 @@ int pseudofs_update(char *hostname, char *path, nfs_export *source) void v4root_set() { - nfs_export *exp, *nxt; + nfs_export *exp; int i; char *path, *ptr; char *hostname; @@ -158,10 +158,16 @@ v4root_set() return; for (i = 0; i < MCL_MAXTYPES; i++) { - for (exp = exportlist[i].p_head; exp; exp = nxt) { - nxt = exp->m_next; + for (exp = exportlist[i].p_head; exp; exp = exp->m_next) { hostname = exp->m_export.e_hostname; + if (exp->m_export.e_flags & NFSEXP_V4ROOT) + /* + * We just added this one, so its + * parents are already dealt with! + */ + continue; + path = strdup(exp->m_export.e_path); for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) { int ret;