From mteterin@250-217.customer.cloud9.net  Wed Apr 14 09:14:31 2004
Return-Path: <mteterin@250-217.customer.cloud9.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 4A7B316A4CE; Wed, 14 Apr 2004 09:14:31 -0700 (PDT)
Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id D24B943D58; Wed, 14 Apr 2004 09:14:30 -0700 (PDT)
	(envelope-from mteterin@250-217.customer.cloud9.net)
Received: from 250-217.customer.cloud9.net (195-11.customer.cloud9.net [168.100.195.11])
	by corbulon.video-collage.com (8.12.11/8.12.11) with ESMTP id i3EGESHQ043827
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Apr 2004 12:14:29 -0400 (EDT)
	(envelope-from mteterin@250-217.customer.cloud9.net)
Received: from 250-217.customer.cloud9.net (mteterin@localhost [127.0.0.1])
	by 250-217.customer.cloud9.net (8.12.11/8.12.10) with ESMTP id i3EGEMrj069992
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Apr 2004 12:14:23 -0400 (EDT)
	(envelope-from mteterin@250-217.customer.cloud9.net)
Received: (from mteterin@localhost)
	by 250-217.customer.cloud9.net (8.12.11/8.12.10/Submit) id i3EGEMlY069991;
	Wed, 14 Apr 2004 12:14:22 -0400 (EDT)
	(envelope-from mteterin)
Message-Id: <200404141614.i3EGEMlY069991@250-217.customer.cloud9.net>
Date: Wed, 14 Apr 2004 12:14:22 -0400 (EDT)
From: Mikhail Teterin <mi@aldan.algebra.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: mpp@freebsd.org, jmacd@freebsd.org
Subject: minor improvement to getgrent.3
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         65530
>Category:       docs
>Synopsis:       [patch] minor improvement to getgrent(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 14 09:20:12 PDT 2004
>Closed-Date:    Thu Oct 12 08:45:14 GMT 2006
>Last-Modified:  Thu Oct 12 08:45:14 GMT 2006
>Originator:     Mikhail Teterin
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	The man-page for getgrent and friends gives the layout of the
	``struct group'', but does not explicitly mention, that the list
	of group members in the gr_mem is NULL terminated.

	Since there is nothing like "gr_mem_len" anywhere, the NULL
	termination can be deduced, but explicitly documenting it
	would be useful. For example, the

	http://www.cs.vu.nl/pub/minix/2.0.0/wwwman/man3/getgrent.3.html

	offers Minix' man-page, where the gr_mem is explicitly documented
	to be NULL-terminated.

	In fact, ours was too:

	----------------------------
	revision 1.5
	date: 1996/06/20 14:13:15;  author: jmacd;  state: Exp;  lines: +2 -2
	branches:  1.5.2;
	I hate to read a man page that almost has useful information
	but falls a little short.  I added a comment on the null
	termination of struct group's gr_mem field.

	Reviewed by:    jkh
	----------------------------

	but was removed for some reason in 1.8 -- probably a
	branch/trunk misunderstanding with 1.8 overwriting the
	changes in 1.5.2...

	----------------------------
	revision 1.8
	date: 1997/01/30 23:01:47;  author: mpp;  state: Exp;  lines: +2 -2
	Update to reflect current include files.
	----------------------------


>How-To-Repeat:

>Fix:

	The exact verbiage is, probably, not important. jmacd's version
	and the Minix link above use word "null". I think, "NULL" is better,
	but don't have a strong opinion: 

===================================================================
RCS file: /home/ncvs/src/lib/libc/gen/getgrent.3,v
retrieving revision 1.23
diff -U2 -r1.23 getgrent.3
--- getgrent.3	8 Sep 2003 19:57:14 -0000	1.23
+++ getgrent.3	14 Apr 2004 16:09:58 -0000
@@ -85,5 +85,5 @@
 	char	*gr_passwd;	/* group password */
 	gid_t	gr_gid;		/* group id */
-	char	**gr_mem;	/* group members */
+	char	**gr_mem;	/* NULL-terminated list of group members */
 };
 .Ed
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: trhodes 
State-Changed-When: Thu Oct 12 08:43:04 UTC 2006 
State-Changed-Why:  
This information is duplicated from the /usr/include/grp.h 
header file, we should change both or none.  I don't see a 
good reason to really change them right now as it seems seems 
self-explainatory.  Thanks for the submission! 


Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Thu Oct 12 08:43:04 UTC 2006 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65530 
>Unformatted:
