dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Serge E. Hallyn 2009-04-08 16:55:58 -05:00 committed by James Morris
parent 577c9c456f
commit 5bf37ec3e0
1 changed files with 0 additions and 1 deletions

View File

@ -916,7 +916,6 @@ changed:
return commit_creds(new);
no_change:
error = 0;
error:
abort_creds(new);
return error;