X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=security%2Fcommoncap.c;h=57673ee07ceb59b45a05167ab1766eb551ad4ac8;hb=74e651f0aa100f3e5d3432a8dd8869c089e8d72f;hp=04c12f58d656200b29c1e0c60c31e7ac62349741;hpb=aef7b83c92dd0b7e994805440655d1d64147287b;p=linux-2.6-omap-h63xx.git diff --git a/security/commoncap.c b/security/commoncap.c index 04c12f58d65..57673ee07ce 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include @@ -32,9 +33,9 @@ int cap_netlink_send(struct sock *sk, struct sk_buff *skb) EXPORT_SYMBOL(cap_netlink_send); -int cap_netlink_recv(struct sk_buff *skb) +int cap_netlink_recv(struct sk_buff *skb, int cap) { - if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) + if (!cap_raised(NETLINK_CB(skb).eff_cap, cap)) return -EPERM; return 0; } @@ -59,8 +60,8 @@ int cap_settime(struct timespec *ts, struct timezone *tz) int cap_ptrace (struct task_struct *parent, struct task_struct *child) { /* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */ - if (!cap_issubset (child->cap_permitted, current->cap_permitted) && - !capable(CAP_SYS_PTRACE)) + if (!cap_issubset(child->cap_permitted, parent->cap_permitted) && + !__capable(parent, CAP_SYS_PTRACE)) return -EPERM; return 0; }