summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2021-09-05 19:45:05 -0700
committerAndrew G. Morgan <morgan@kernel.org>2021-09-05 19:45:05 -0700
commitf223de46154a3d2644914ea358d5c69b36770459 (patch)
tree40c36b45a8fa93b2232eca6a6834ad755089fc38
parent967b3a0a95223036478e7d991ee96fa42912803a (diff)
downloadlibcap2-f223de46154a3d2644914ea358d5c69b36770459.tar.gz
Treat ENOTSUP as an expected error for getcap.
Things like /proc/* files don't support capabilities on them and if getcap looks at them it generates a lot of errors. Treat it as equivalent to there being no capability on the file. This addresses https://bugzilla.kernel.org/show_bug.cgi?id=214317 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--progs/getcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/progs/getcap.c b/progs/getcap.c
index 7df7f0e..780943d 100644
--- a/progs/getcap.c
+++ b/progs/getcap.c
@@ -49,7 +49,7 @@ static int do_getcap(const char *fname, const struct stat *stbuf,
cap_d = cap_get_file(fname);
if (cap_d == NULL) {
- if (errno != ENODATA) {
+ if (errno != ENODATA && errno != ENOTSUP) {
fprintf(stderr, "Failed to get capabilities of file '%s' (%s)\n",
fname, strerror(errno));
} else if (verbose) {