Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH 5/9] user namespace: clamp down users of cap_raised | Date | Wed, 19 Oct 2011 10:01:08 +0100 |
| |
> #define NS_IS_NON_DEFAULT (current_user_ns() != &init_user_ns)
How about:
#define IN_ROOT_USER_NS (current_user_ns() == &init_user_ns)
And then:
if (!IN_ROOT_USER_NS() || !cap_raised(current_cap(), CAP_SYS_ADMIN)) {
I think it reads better.
David
| |