summaryrefslogtreecommitdiff
path: root/nfs/cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'nfs/cred.c')
-rw-r--r--nfs/cred.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/nfs/cred.c b/nfs/cred.c
index 4a1829cd..7637a99d 100644
--- a/nfs/cred.c
+++ b/nfs/cred.c
@@ -82,3 +82,23 @@ netfs_make_credential (uid_t *uids,
return cred;
}
+
+int
+cred_has_uid (struct netcred *cred, uid_t uid)
+{
+ int i;
+ for (i = 0; i < cred->nuids; i++)
+ if (cred->uids[i] == uid)
+ return 1;
+ return 0;
+}
+
+int
+cred_has_gid (struct netcred *cred, gid_t gid)
+{
+ int i;
+ for (i = 0; i < cred->ngids; i++)
+ if (cred->gids[i] == gid)
+ return 1;
+ return 0;
+}