.e_nsqgids = 0,
.e_fsid = 0,
.e_mountpoint = NULL,
+ .e_ttl = DEFAULT_TTL,
},
.m_exported = 0,
.m_xtabent = 1,
struct exportent *curexp = &export->m_export;
dupexportent(&eep, &pseudo_root.m_export);
- eep.e_hostname = strdup(curexp->e_hostname);
+ eep.e_hostname = curexp->e_hostname;
strncpy(eep.e_path, path, sizeof(eep.e_path));
if (strcmp(path, "/") != 0)
eep.e_flags &= ~NFSEXP_FSID;
char *ptr;
path = strdup(exp->m_export.e_path);
- if (!path)
+ if (!path) {
+ xlog(L_WARNING, "v4root_add_parents: Unable to create "
+ "pseudo export for '%s'", exp->m_export.e_path);
return -ENOMEM;
- for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) {
+ }
+ for (ptr = path; ptr; ptr = strchr(ptr, '/')) {
int ret;
char saved;
saved = *ptr;
*ptr = '\0';
- ret = pseudofs_update(hostname, path, exp);
+ ret = pseudofs_update(hostname, *path ? path : "/", exp);
if (ret)
return ret;
*ptr = saved;
v4root_set()
{
nfs_export *exp;
- int i, ret;
+ int i;
if (!v4root_needed)
return;
*/
continue;
- ret = v4root_add_parents(exp);
+ if (strcmp(exp->m_export.e_path, "/") == 0 &&
+ !(exp->m_export.e_flags & NFSEXP_FSID)) {
+ /* Force '/' to be exported as fsid == 0*/
+ exp->m_export.e_flags |= NFSEXP_FSID;
+ exp->m_export.e_fsid = 0;
+ }
+
+ v4root_add_parents(exp);
/* XXX: error handling! */
}
}