summaryrefslogtreecommitdiff
path: root/libtrivfs/priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'libtrivfs/priv.h')
-rw-r--r--libtrivfs/priv.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libtrivfs/priv.h b/libtrivfs/priv.h
index d92fe336..4bdd4f77 100644
--- a/libtrivfs/priv.h
+++ b/libtrivfs/priv.h
@@ -21,6 +21,15 @@
#include <mach.h>
#include <hurd.h>
#include <hurd/ports.h>
+#include <idvec.h>
+#include <unistd.h>
#include "trivfs.h"
+/* Returns true if UIDS contains either 0 or our user id. */
+static inline int
+_is_privileged (struct idvec *uids)
+{
+ return idvec_contains (uids, 0) || idvec_contains (uids, getuid ());
+}
+
#endif