From: Serge E. Hallyn Date: Wed, 8 Apr 2009 21:55:58 +0000 (-0500) Subject: cap_prctl: don't set error to 0 at 'no_change' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5bf37ec3e0f5eb79f23e024a7fbc8f3557c087f0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cap_prctl: don't set error to 0 at 'no_change' One-liner: capsh --print is broken without this patch. In certain cases, cap_prctl returns error > 0 for success. However, the 'no_change' label was always setting error to 0. As a result, for example, 'prctl(CAP_BSET_READ, N)' would always return 0. It should return 1 if a process has N in its bounding set (as by default it does). I'm keeping the no_change label even though it's now functionally the same as 'error'. Signed-off-by: Serge Hallyn Acked-by: David Howells Signed-off-by: James Morris --- diff --git a/security/commoncap.c b/security/commoncap.c index 7cd61a5f5205..beac0258c2a8 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -916,7 +916,6 @@ changed: return commit_creds(new); no_change: - error = 0; error: abort_creds(new); return error;