Bug 65530

Summary: [patch] minor improvement to getgrent(3)
Product: Documentation Reporter: Mikhail T. <freebsd-2024>
Component: Books & ArticlesAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me CC: mpp
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Mikhail T. 2004-04-14 17:20:12 UTC
	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.
	----------------------------

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
Comment 1 Tom Rhodes freebsd_committer freebsd_triage 2006-10-12 09:43:04 UTC
State Changed
From-To: open->closed

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! 


Comment 2 Tom Rhodes freebsd_committer freebsd_triage 2006-10-12 09:43:04 UTC
Responsible Changed
From-To: freebsd-doc->trhodes

Over to me.