X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=security%2Fsecurity.c;h=51ef509710b9d50bc7aa65d89cbf7bde359a6126;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=b457664412835d8e2a2629098a87769a9d864037;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/security/security.c b/security/security.c index b45766441..51ef50971 100644 --- a/security/security.c +++ b/security/security.c @@ -11,6 +11,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -173,48 +174,8 @@ int mod_unreg_security(const char *name, struct security_operations *ops) return security_ops->unregister_security(name, ops); } -/** - * capable - calls the currently loaded security module's capable() function with the specified capability - * @cap: the requested capability level. - * - * This function calls the currently loaded security module's capable() - * function with a pointer to the current task and the specified @cap value. - * - * This allows the security module to implement the capable function call - * however it chooses to. - */ -int capable(int cap) -{ - if (vx_check_bit(VXC_CAP_MASK, cap) && !vx_mcaps(1L << cap)) - return 0; - if (security_ops->capable(current, cap)) { - /* capability denied */ - return 0; - } - - /* capability granted */ - current->flags |= PF_SUPERPRIV; - return 1; -} - -int vx_capable(int cap, int ccap) -{ - if (security_ops->capable(current, cap)) { - /* capability denied */ - return 0; - } - if (!vx_ccaps(ccap)) - return 0; - - /* capability granted */ - current->flags |= PF_SUPERPRIV; - return 1; -} - EXPORT_SYMBOL_GPL(register_security); EXPORT_SYMBOL_GPL(unregister_security); EXPORT_SYMBOL_GPL(mod_reg_security); EXPORT_SYMBOL_GPL(mod_unreg_security); -EXPORT_SYMBOL(capable); -EXPORT_SYMBOL(vx_capable); EXPORT_SYMBOL(security_ops);