walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
Blob Blame History Raw
diff -up nfs-utils-1.3.0/support/export/client.c.orig nfs-utils-1.3.0/support/export/client.c
--- nfs-utils-1.3.0/support/export/client.c.orig	2014-11-04 15:30:01.255646000 -0500
+++ nfs-utils-1.3.0/support/export/client.c	2014-11-04 15:30:28.070441000 -0500
@@ -277,7 +277,7 @@ client_lookup(char *hname, int canonical
 	if (htype == MCL_FQDN && !canonical) {
 		ai = host_addrinfo(hname);
 		if (!ai) {
-			xlog(L_ERROR, "Failed to resolve %s", hname);
+			xlog(L_WARNING, "Failed to resolve %s", hname);
 			goto out;
 		}
 		hname = ai->ai_canonname;
diff -up nfs-utils-1.3.0/support/export/export.c.orig nfs-utils-1.3.0/support/export/export.c
--- nfs-utils-1.3.0/support/export/export.c.orig	2014-03-25 11:12:07.000000000 -0400
+++ nfs-utils-1.3.0/support/export/export.c	2014-11-04 15:30:28.076440000 -0500
@@ -76,15 +76,22 @@ export_read(char *fname)
 	struct exportent	*eep;
 	nfs_export		*exp;
 
+	int volumes = 0;
+
 	setexportent(fname, "r");
 	while ((eep = getexportent(0,1)) != NULL) {
 		exp = export_lookup(eep->e_hostname, eep->e_path, 0);
-		if (!exp)
-			export_create(eep, 0);
+		if (!exp) {
+			exp = export_create(eep, 0);
+			if (exp)
+				volumes++;
+		}
 		else
 			warn_duplicated_exports(exp, eep);
 	}
 	endexportent();
+	if (volumes == 0)
+		xlog(L_ERROR, "No file systems exported!");
 }
 
 /**
diff -up nfs-utils-1.3.0/support/export/hostname.c.orig nfs-utils-1.3.0/support/export/hostname.c
--- nfs-utils-1.3.0/support/export/hostname.c.orig	2014-03-25 11:12:07.000000000 -0400
+++ nfs-utils-1.3.0/support/export/hostname.c	2014-11-04 15:30:28.081441000 -0500
@@ -175,11 +175,11 @@ host_addrinfo(const char *hostname)
 	case 0:
 		return ai;
 	case EAI_SYSTEM:
-		xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m",
+		xlog(D_PARSE, "%s: failed to resolve %s: (%d) %m",
 				__func__, hostname, errno);
 		break;
 	default:
-		xlog(D_GENERAL, "%s: failed to resolve %s: %s",
+		xlog(D_PARSE, "%s: failed to resolve %s: %s",
 				__func__, hostname, gai_strerror(error));
 		break;
 	}