Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2022 13:55:20 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Ronald Klop <ronald-lists@klop.ws>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: Sanity limit for length of user/group names?
Message-ID:  <YT2PR01MB973032842BD187D08DD0D1B6DDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <837488522.1046.1649831759547@localhost>
References:  <YT2PR01MB97304F4066E62581CF01DC00DDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM> <837488522.1046.1649831759547@localhost>

index | next in thread | previous in thread | raw e-mail

Ronald Klop <ronald-lists@klop.ws> wrote:
> Hi,
>
> A google search gives me this page: https://forums.freebsd.org/threads/username-length-16.28189/ .
> It talks about MAXLOGNAME and limits in utmp.
Yep, I had forgotten about that one.
However, it is very small (and can be increased for a build) and I think it only applies
to user names and not group names.

When I look in getgrent.c, the only limit I see is for the entire "struct group", which is
GRP_STORAGE_MAX, set to 1Mbyte. (1Mbyte seems larger than I would want to set
the sanity limit to.)
I'll experiment with a long group name and see what happens, at least for the local
/etc/group file case.

Thanks, rick

Regards,
Ronald


Van: Rick Macklem <rmacklem@uoguelph.ca>
Datum: 13 april 2022 03:08
Aan: freebsd-current <freebsd-current@freebsd.org>
Onderwerp: Sanity limit for length of user/group names?

Hi,

The NFSv4 RFCs do not specify an upper limit for the length
of a user or group (called Owner/Owner_group in NFSv4) string.

However, PR#260546 notes that a sanity upper limit for their
length is needed.

Is there any constant in FreeBSD that defines the upper limit for
the length of a user or group name?
(I can find the maximum length of a hostname and I think that can
 be used as a safe upper limit for a domain name, as well. The Owner/
 Owner_group names include "@domain" on them.)

Thanks for any help with this, rick

________________________________





help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YT2PR01MB973032842BD187D08DD0D1B6DDEC9>