.e_nsqgids = 0,
.e_fsid = 0,
.e_mountpoint = NULL,
+ .e_ttl = DEFAULT_TTL,
},
.m_exported = 0,
.m_xtabent = 1,
if (source->e_flags & NFSEXP_INSECURE_PORT)
pseudo->e_flags |= NFSEXP_INSECURE_PORT;
+ if ((source->e_flags & NFSEXP_ROOTSQUASH) == 0)
+ pseudo->e_flags &= ~NFSEXP_ROOTSQUASH;
for (se = source->e_secinfo; se->flav; se++) {
struct sec_entry *new;
exp = export_create(&eep, 0);
if (exp == NULL)
return NULL;
- xlog(D_CALL, "v4root_create: path '%s'", exp->m_export.e_path);
+ xlog(D_CALL, "v4root_create: path '%s' flags 0x%x",
+ exp->m_export.e_path, exp->m_export.e_flags);
return &exp->m_export;
}
"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;
*/
continue;
+ 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! */
}