From 2ee2df24ef59af4d0c3fa0d224dd520725999379 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 19 Mar 1996 18:01:57 +0000 Subject: entered into RCS --- nfs/cred.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nfs/cred.c') 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 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 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 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 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) { -- cgit v1.2.3