Commit 7771a043 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] capability.c thinko

Apparently my understanding of C brace rules was blurred and there is a
thinko in kernel/capability.c - what we want is what the indention
reflects but what we get is an unconditional return of -EINVAL.
parent 8ada990c
......@@ -39,10 +39,11 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
if (get_user(version, &header->version))
return -EFAULT;
if (version != _LINUX_CAPABILITY_VERSION)
if (version != _LINUX_CAPABILITY_VERSION) {
if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
return -EFAULT;
return -EINVAL;
}
if (get_user(pid, &header->pid))
return -EFAULT;
......@@ -134,10 +135,11 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
if (get_user(version, &header->version))
return -EFAULT;
if (version != _LINUX_CAPABILITY_VERSION)
if (version != _LINUX_CAPABILITY_VERSION) {
if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
return -EFAULT;
return -EINVAL;
}
if (get_user(pid, &header->pid))
return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment