getgrnam(3) bug

cball at ishmael cball at ishmael
Tue May 24 00:54:00 AEST 1988


>/* Written  5:32 am  May 11, 1988 by rcodi at yabbie.UUCP in ishmael:comp.bugs.4bsd */
>/* ---------- "getgrnam(3) bug" ---------- */
>Description:
>	getgrnam(3) fails to read 2nd and subsequent lines of a
>	multi-line group specification.

This is a real headache when you have a large user community.  Leaving default
groups out of the group file helps.  We have locally developed adduser and
chdgrp(change default login group) programs that maintain this configuration.
However, it is entirely possible to exceed max line lenghts with secondary
group memebers.

>Repeat-By:
>		testgroup:*:1234:somebodyelse
>		testgroup:*:1234:myself

This proposed format significantly changes the semantics of the group file.
A more natural extension would be the use of a line continuation character.
I suggest the following:

		testgroup:*:1234:somebody,somebodyelse,\
		myself,yourself

This is a common mechanism that can easily be added as a patch to the
existing code.  Just change grskip() in getgrent.c to fgets() the next
line when it matches a '/'.

	Charles Ball
	Intermetrics, Inc.



More information about the Comp.bugs.4bsd.ucb-fixes mailing list