From f223de46154a3d2644914ea358d5c69b36770459 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Sun, 5 Sep 2021 19:45:05 -0700 Subject: 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 --- progs/getcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'progs') 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) { -- cgit v1.2.1