summaryrefslogtreecommitdiff
path: root/nfs/cred.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-03-19 18:01:57 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-03-19 18:01:57 +0000
commit2ee2df24ef59af4d0c3fa0d224dd520725999379 (patch)
treea474a7fef84a6f2bb85dd516b2823e5bc4908033 /nfs/cred.c
parentb6724432098709311f2cc2867c7734b41abe105a (diff)
entered into RCS
Diffstat (limited to 'nfs/cred.c')
-rw-r--r--nfs/cred.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/nfs/cred.c b/nfs/cred.c
index 7637a99d..b83ebaaf 100644
--- a/nfs/cred.c
+++ b/nfs/cred.c
@@ -1,5 +1,5 @@
-/* NFS credential manipulation
- Copyright (C) 1995 Free Software Foundation, Inc.
+/* Credential manipulation for NFS client
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -23,8 +23,13 @@
#include "nfs.h"
+/* This lock must always be held when manipulating the reference count
+ on credential structures. */
static spin_lock_t cred_refcnt_lock = SPIN_LOCK_INITIALIZER;
+/* Interpret CRED, returning newly malloced storage describing the
+ user identification references in UIDS, NUIDS, GIDS, and NGIDS.
+ See <hurd/libnetfs.h> for details. */
void
netfs_interpret_credential (struct netcred *cred, uid_t **uids,
int *nuids, uid_t **gids, int *ngids)
@@ -36,6 +41,7 @@ netfs_interpret_credential (struct netcred *cred, uid_t **uids,
cred->ngids * sizeof (uid_t));
}
+/* Return a new reference to CRED. See <hurd/libnetfs.h> for details. */
struct netcred *
netfs_copy_credential (struct netcred *cred)
{
@@ -45,6 +51,7 @@ netfs_copy_credential (struct netcred *cred)
return cred;
}
+/* Drop a reference to CRED. See <hurd/libnetfs.h> for details. */
void
netfs_drop_credential (struct netcred *cred)
{
@@ -60,6 +67,9 @@ netfs_drop_credential (struct netcred *cred)
spin_unlock (&cred_refcnt_lock);
}
+/* Make and return a new credential referring to the user identified
+ by UIDS, NUIDS, GIDS, and NGIDS. See <hurd/libnetfs.h> for
+ details. */
struct netcred *
netfs_make_credential (uid_t *uids,
int nuids,
@@ -83,6 +93,7 @@ netfs_make_credential (uid_t *uids,
return cred;
}
+/* Return nonzero iff CRED contains user id UID. */
int
cred_has_uid (struct netcred *cred, uid_t uid)
{
@@ -93,6 +104,7 @@ cred_has_uid (struct netcred *cred, uid_t uid)
return 0;
}
+/* Return nonzero iff CRED contains group id GID. */
int
cred_has_gid (struct netcred *cred, gid_t gid)
{