Index | Thread | Search

From:
David Leadbeater <dgl@dgl.cx>
Subject:
Re: user(8) group line limit
To:
"Todd C. Miller" <Todd.Miller@sudo.ws>
Cc:
tech@openbsd.org
Date:
Thu, 12 Mar 2026 13:52:37 +1100

Download raw body.

Thread
On Wed, Mar 11, 2026 at 08:40:54PM -0600, Todd C. Miller wrote:
> On Thu, 12 Mar 2026 12:22:48 +1100, David Leadbeater wrote:
> 
> > The line length limit used for /etc/group in user(8) does not match what
> > group(5) documents. This results in a command like usermod -G group user
> > succeeding, but getgrent(2) no longer accepting the line, resulting in
> > all the users appearing to drop out of the group.
> 
> Is there a reason you didn't just limit the size of buf in the group
> functions to 1024 (or some define)?  It looks like that would also
> have the desired effect.

The thought crossed my mind, mainly I did it because it matches the
pattern in adduser/moduser, they use buf[LINE_MAX] and then actually
limit to 1023. Although they are dealing with '&' expansion so the code
is slightly different, but same pattern. I don't know why they are doing
that though.