Skip to contentSkip to conversation

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

PATCH Daniel J Walsh 2 participants 2 messages Jul 7, 2009 – Sep 24, 2009 SELinux security module

lore
Share & tools
lore
#0 lore raw

Subject: [PATCH] refpolicy: nsalibselinux_utils_matchpathcon.c changes --text follows this line--

utils/matchpathcon.c +7 -3
@@ -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);
#1 lore raw
Quoted 1 line · Daniel J Walsh

Merged in libselinux-2.0.87

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.