From owner-freebsd-doc Sun Nov 25 12: 0:14 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C881637B41C for ; Sun, 25 Nov 2001 12:00:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fAPK02g96116; Sun, 25 Nov 2001 12:00:02 -0800 (PST) (envelope-from gnats) Received: from mail.acns.ab.ca (h24-64-56-135.cg.shawcable.net [24.64.56.135]) by hub.freebsd.org (Postfix) with ESMTP id 2784937B417 for ; Sun, 25 Nov 2001 11:50:16 -0800 (PST) Received: from colnta.acns.ab.ca (colnta.acns.ab.ca [192.168.1.2]) by mail.acns.ab.ca (8.11.6/8.11.3) with ESMTP id fAPJoFb93990 for ; Sun, 25 Nov 2001 12:50:15 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: (from davidc@localhost) by colnta.acns.ab.ca (8.11.6/8.11.3) id fAPJoF895198; Sun, 25 Nov 2001 12:50:15 -0700 (MST) (envelope-from davidc) Message-Id: <200111251950.fAPJoF895198@colnta.acns.ab.ca> Date: Sun, 25 Nov 2001 12:50:15 -0700 (MST) From: Chad David Reply-To: Chad David To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/32275: update ucred.9 Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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