Matchpathcon patch to print <<none>> when it gets enoent.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Subject: [PATCH] refpolicy: nsalibselinux_utils_matchpathcon.c changes
--text follows this line--
--- nsalibselinux/utils/matchpathcon.c	2009-07-07 11:10:42.033956000 -0400
+++ libselinux-2.0.83/utils/matchpathcon.c	2009-07-07 12:22:39.395209000 -0400
@@ -22,9 +22,13 @@
 	char *buf;
 	int rc = matchpathcon(path, mode, &buf);
 	if (rc < 0) {
-		fprintf(stderr, "matchpathcon(%s) failed: %s\n", path,
-			strerror(errno));
-		return 1;
+		if (errno == ENOENT) {
+			buf=strdup("<<none>>");
+		} else {
+			fprintf(stderr, "matchpathcon(%s) failed: %s\n", path,
+				strerror(errno));
+			return 1;
+		}
 	}
 	if (header)
 		printf("%s\t%s\n", path, buf);

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux