--- zzzz-none-000/linux-2.6.19.2/kernel/capability.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/kernel/capability.c 2007-01-19 14:42:56.000000000 +0000 @@ -12,6 +12,7 @@ #include #include #include +#include #include unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */ @@ -234,14 +235,25 @@ return ret; } +extern int gr_task_is_capable(struct task_struct *task, const int cap); +extern int gr_is_capable_nolog(const int cap); + int __capable(struct task_struct *t, int cap) { - if (security_capable(t, cap) == 0) { + if ((security_capable(t, cap) == 0) && gr_task_is_capable(t, cap)) { t->flags |= PF_SUPERPRIV; return 1; } return 0; } +int capable_nolog(int cap) +{ + if ((security_capable(current, cap) == 0) && gr_is_capable_nolog(cap)) { + current->flags |= PF_SUPERPRIV; + return 1; + } + return 0; +} EXPORT_SYMBOL(__capable); int capable(int cap) @@ -249,3 +261,4 @@ return __capable(current, cap); } EXPORT_SYMBOL(capable); +EXPORT_SYMBOL(capable_nolog);