Date: Wed, 13 Apr 2022 14:11:22 +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: <YT2PR01MB9730DEB55A48C0029FF4082BDDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <YT2PR01MB973032842BD187D08DD0D1B6DDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM> References: <YT2PR01MB97304F4066E62581CF01DC00DDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM> <837488522.1046.1649831759547@localhost> <YT2PR01MB973032842BD187D08DD0D1B6DDEC9@YT2PR01MB9730.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
Rick Macklem <rmacklem@uoguelph.ca> wrote:=0A= > Ronald Klop <ronald-lists@klop.ws> wrote:=0A= > > Hi,=0A= > >=0A= > > A google search gives me this page: https://forums.freebsd.org/threads/= username-length-16.28189/ .=0A= > > It talks about MAXLOGNAME and limits in utmp.=0A= > Yep, I had forgotten about that one.=0A= > However, it is very small (and can be increased for a build) and I think = it only applies=0A= > to user names and not group names.=0A= >=0A= > When I look in getgrent.c, the only limit I see is for the entire "struct= group", which is=0A= > GRP_STORAGE_MAX, set to 1Mbyte. (1Mbyte seems larger than I would want to= set=0A= > the sanity limit to.)=0A= > I'll experiment with a long group name and see what happens, at least for= the local=0A= > /etc/group file case.=0A= I just tried a group with a name > 1K and it worked, so it does appear that= the only limit=0A= is the 1Mbyte for the entire "struct group", at least for the local /etc/gr= oup=0A= file case.=0A= =0A= My current patch for the NFSv4 server uses 10K as a sanity limit and maybe = I'll=0A= just stick with that.=0A= =0A= Thanks, rick=0A= =0A= Regards,=0A= Ronald=0A= =0A= =0A= Van: Rick Macklem <rmacklem@uoguelph.ca>=0A= Datum: 13 april 2022 03:08=0A= Aan: freebsd-current <freebsd-current@freebsd.org>=0A= Onderwerp: Sanity limit for length of user/group names?=0A= =0A= Hi,=0A= =0A= The NFSv4 RFCs do not specify an upper limit for the length=0A= of a user or group (called Owner/Owner_group in NFSv4) string.=0A= =0A= However, PR#260546 notes that a sanity upper limit for their=0A= length is needed.=0A= =0A= Is there any constant in FreeBSD that defines the upper limit for=0A= the length of a user or group name?=0A= (I can find the maximum length of a hostname and I think that can=0A= be used as a safe upper limit for a domain name, as well. The Owner/=0A= Owner_group names include "@domain" on them.)=0A= =0A= Thanks for any help with this, rick=0A= =0A= ________________________________=0A= =0A= =0A= =0A=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YT2PR01MB9730DEB55A48C0029FF4082BDDEC9>