* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*/
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <sys/fcntl.h>
#include <unistd.h>
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)
{
/* 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);
/*
* rename newfile onto oldfile unless
- * they are identical
+ * they are identical
*/
static void cond_rename(char *newfile, char *oldfile)
{