* Matchpathcon patch to print <<none>> when it gets enoent.
@ 2009-07-07 16:30 Daniel J Walsh
2009-09-24 19:20 ` Joshua Brindle
0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Walsh @ 2009-07-07 16:30 UTC (permalink / raw)
To: SE Linux
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: libselinux-matchpathcon.patch --]
[-- Type: text/plain, Size: 655 bytes --]
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-24 19:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 16:30 Matchpathcon patch to print <<none>> when it gets enoent Daniel J Walsh
2009-09-24 19:20 ` Joshua Brindle
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.