return xtab_read(_PATH_ETAB, 1);
}
+/*
+ * mountd now keeps an open fd for the etab at all times to make sure that the
+ * inode number changes when the xtab_export_write is done. If you change the
+ * routine below such that the files are edited in place, then you'll need to
+ * fix the auth_reload logic as well...
+ */
static int
xtab_write(char *xtab, char *xtabtmp, int is_export)
{
setexportent(xtabtmp, "w");
for (i = 0; i < MCL_MAXTYPES; i++) {
- for (exp = exportlist[i]; exp; exp = exp->m_next) {
+ for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
if (is_export && !exp->m_xtabent)
continue;
if (!is_export && ! exp->m_exported)
/* write out the export entry using the FQDN */
xe = exp->m_export;
- strncpy(xe.e_hostname,
- exp->m_client->m_hostname,
- sizeof (xe.e_hostname) - 1);
- xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0';
+ xe.e_hostname = exp->m_client->m_hostname;
putexportent(&xe);
}
}
return;
setexportent(_PATH_XTAB, "a");
xe = exp->m_export;
- strncpy(xe.e_hostname, exp->m_client->m_hostname,
- sizeof (xe.e_hostname) - 1);
- xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0';
+ xe.e_hostname = exp->m_client->m_hostname;
putexportent(&xe);
endexportent();
xfunlock(lockid);