+void
+exportent_release(struct exportent *eep)
+{
+ xfree(eep->e_squids);
+ xfree(eep->e_sqgids);
+ free(eep->e_mountpoint);
+ free(eep->e_fslocdata);
+ free(eep->e_uuid);
+ xfree(eep->e_hostname);
+}
+
+static void
+export_free(nfs_export *exp)
+{
+ exportent_release(&exp->m_export);
+ xfree(exp);
+}
+
+static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
+{
+ if (exp->m_export.e_flags != eep->e_flags) {
+ xlog(L_ERROR, "incompatible duplicated export entries:");
+ xlog(L_ERROR, "\t%s:%s (0x%x) [IGNORED]", eep->e_hostname,
+ eep->e_path, eep->e_flags);
+ xlog(L_ERROR, "\t%s:%s (0x%x)", exp->m_export.e_hostname,
+ exp->m_export.e_path, exp->m_export.e_flags);
+ } else {
+ xlog(L_ERROR, "duplicated export entries:");
+ xlog(L_ERROR, "\t%s:%s", eep->e_hostname, eep->e_path);
+ xlog(L_ERROR, "\t%s:%s", exp->m_export.e_hostname,
+ exp->m_export.e_path);
+ }
+}
+
+/**
+ * export_read - read entries from /etc/exports
+ * @fname: name of file to read from
+ *
+ */
+void