diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2009-04-08 17:55:58 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-04-08 19:12:03 -0400 |
commit | 5bf37ec3e0f5eb79f23e024a7fbc8f3557c087f0 (patch) | |
tree | 555033e32330726df31fa68244656e11eae39490 /security | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) |
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 <serue@us.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/commoncap.c | 1 |
1 files changed, 0 insertions, 1 deletions
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: | |||
916 | return commit_creds(new); | 916 | return commit_creds(new); |
917 | 917 | ||
918 | no_change: | 918 | no_change: |
919 | error = 0; | ||
920 | error: | 919 | error: |
921 | abort_creds(new); | 920 | abort_creds(new); |
922 | return error; | 921 | return error; |