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>
/* 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_host_unpriv(void)
{
FILE *f;