X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=security%2Fcommoncap.c;h=5a5ef5ca7ea97eb9a2ef3901e3faff71fcaefcc6;hp=841eb4e5c62b6e91b0e799802791289366bfb45d;hb=820ae1b865caa05e0614004d0183ca70de2b8665;hpb=b55813a2e50088ca30df33fa62aeed5d3adb1796 diff --git a/security/commoncap.c b/security/commoncap.c index 841eb4e5c62b..5a5ef5ca7ea9 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -8,7 +8,6 @@ */ #include -#include #include #include #include @@ -33,9 +32,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; } @@ -170,7 +169,7 @@ void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) /* For init, we want to retain the capabilities set * in the init_task struct. Thus we skip the usual * capability rules */ - if (current->pid != 1) { + if (!is_init(current)) { current->cap_permitted = new_permitted; current->cap_effective = cap_intersect (new_permitted, bprm->cap_effective);