Sometimes we want to know whether we are privileged wrt our
namespaces, and sometimes we want to know whether we are priv
wrt init_user_ns.
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
/* munmap() wrapper. Use it to free memory mmap()ed with lxc_strmmap(). */
extern int lxc_strmunmap(void *addr, size_t length);
-//initialize rand with urandom
+/* initialize rand with urandom */
extern int randseed(bool);
+/* are we unprivileged with respect to our namespaces */
+inline static bool am_guest_unpriv(void) {
+ return geteuid() != 0;
+}
+
+/* are we unprivileged with respect to init_user_ns */
inline static bool am_unpriv(void)
{
FILE *f;