Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2001 12:50:15 -0700 (MST)
From:      Chad David <davidc@acns.ab.ca>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   docs/32275: update ucred.9
Message-ID:  <200111251950.fAPJoF895198@colnta.acns.ab.ca>

next in thread | raw e-mail | index | archive | help

>Number:         32275
>Category:       docs
>Synopsis:       update ucred.9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 25 12:00:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Chad David
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
ACNS Inc.
>Environment:
System: FreeBSD colnta 4.4-STABLE FreeBSD 4.4-STABLE #9: Tue Nov 20 16:38:27 MST 2001 davidc@colnta:/mnt1/obj/usr/src/sys/COLNTA i386


	
>Description:
The ucred.9 manual page is out of date with the current source.
>How-To-Repeat:
man 9 ucred
>Fix:
Apply this patch.

--- ../../src/share/man/man9/ucred.9	Fri Jul 13 12:35:48 2001
+++ ucred.9	Sun Nov 25 12:43:09 2001
@@ -34,6 +34,7 @@
 .Nm crget ,
 .Nm crhold ,
 .Nm crfree ,
+.Nm crshared ,
 .Nm crcopy ,
 .Nm crdup
 .Nd "functions related to user credentials"
@@ -46,8 +47,10 @@
 .Fn crhold "struct ucred *cr"
 .Ft void
 .Fn crfree "struct ucred *cr"
-.Ft "struct ucred *"
-.Fn crcopy "struct ucred *cr"
+.Ft int
+.Fn crshared "struct ucred *cr"
+.Ft void
+.Fn crcopy "struct ucred *dest" "struct ucred *src"
 .Ft "struct ucred *"
 .Fn crdup "struct ucred *cr"
 .Sh DESCRIPTION
@@ -73,30 +76,31 @@
 If the count drops to 0, the storage for the structure is freed.
 .Pp
 The
+.Fn crshared
+function returns true if the credential is shared.
+A credential is considered to be shared if its reference
+count is greater then one.
+.Pp
+The
 .Fn crcopy
-function calls
-.Fn crdup
-to create a new structure, and copies the old credentials,
-if the reference count is greater than 1;
-otherwise, the original is returned.
+function copies the contents of the source (template)
+credential into the destination template.
+The uidinfo structure within the destination is referenced
+by calling
+.Fn uihold .
 .Pp
 The
 .Fn crdup
-function allocates memory for a new structure,
-copies the contents of the original structure
-into it, references the
-.Va cr_uidinfo
-and
-.Va cr_ruidinfo
-fields, sets the reference count
-to 1, and then returns the new structure.
+function allocates memory for a new structure and copies the
+contents of
+.Fa cr
+into it.
+The actual copying is performed by
+.Fn crcopy .
 .Sh RETURN VALUES
 The functions that return values all return a pointer to a
 .Vt ucred
 structure.
-In the case of
-.Fn crcopy ,
-the return value may be the same structure you passed to it.
 .Sh SEE ALSO
 .Xr uihold 9
 .Sh AUTHORS

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111251950.fAPJoF895198>