All of lore.kernel.org
 help / color / mirror / Atom feed
* This patch outputs <<none>> from the matchpathcon command when it gets enoent
@ 2009-05-18 18:17 Daniel J Walsh
  0 siblings, 0 replies; only message in thread
From: Daniel J Walsh @ 2009-05-18 18:17 UTC (permalink / raw)
  To: SE Linux

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: libselinux_matchpathcon.patch --]
[-- Type: text/plain, Size: 557 bytes --]

--- nsalibselinux/utils/matchpathcon.c	2009-05-18 13:53:14.000000000 -0400
+++ libselinux-2.0.81/utils/matchpathcon.c	2009-05-18 14:04:07.000000000 -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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-18 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 18:17 This patch outputs <<none>> from the matchpathcon command when it gets enoent Daniel J Walsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.