aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2021-08-22 14:25:11 -0700
committerAndrew G. Morgan <morgan@kernel.org>2021-08-22 14:25:11 -0700
commit25cdfaf7f813a94612279712a2d6d1e1bb39e08b (patch)
tree52e370533ad000416b6853a4e39d8985344918a9
parentf81144578ff24a70356faafb82e55de8f3e1292f (diff)
downloadlibcap-25cdfaf7f813a94612279712a2d6d1e1bb39e08b.tar.gz
Fix error code handling for failed cap_reset_ambient()
Looks like the system call wrapper wasn't migrated properly when I added support to get fakeroot ( https://bugzilla.kernel.org/show_bug.cgi?id=206539 ) working again. That is, all builds in the inclusive range libcap-[2.28, 2.53] have this issue. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--libcap/cap_proc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libcap/cap_proc.c b/libcap/cap_proc.c
index 5e3f9f9..fdb8cbe 100644
--- a/libcap/cap_proc.c
+++ b/libcap/cap_proc.c
@@ -355,14 +355,9 @@ static int _cap_reset_ambient(struct syscaller_s *sc)
}
}
- result = _libcap_wprctl6(sc, PR_CAP_AMBIENT,
- pr_arg(PR_CAP_AMBIENT_CLEAR_ALL),
- pr_arg(0), pr_arg(0), pr_arg(0), pr_arg(0));
- if (result < 0) {
- errno = -result;
- return -1;
- }
- return result;
+ return _libcap_wprctl6(sc, PR_CAP_AMBIENT,
+ pr_arg(PR_CAP_AMBIENT_CLEAR_ALL),
+ pr_arg(0), pr_arg(0), pr_arg(0), pr_arg(0));
}
/*