Subject: Re: magic symlinks: uid keyword translation
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 10/30/2006 16:02:49
In article <Pine.NEB.4.64.0610301533180.7089@ugly.precedence.co.uk>,
Stephen Borrill  <netbsd@precedence.co.uk> wrote:
>On Mon, 30 Oct 2006, Quentin Garnier wrote:
>> On Mon, Oct 30, 2006 at 02:50:14PM +0200, Elad Efrat wrote:
>>> hi,
>>>
>>> attached diff adds a "uid" keyword translation for magic symlinks.
>>>
>>> any objections?
>[snip]
>>> +			char uidtmp[16];
>>> +
>>> +			(void)snprintf(uidtmp, sizeof(uidtmp) - 1, "%u",
>>> +			    kauth_cred_getuid(p->p_cred));
>>
>> s/16/LOGIN_NAME_MAX/
>
>It's numeric UID not user name, so 16 will be fine.

I think that we should have a constant that specifies what is the string
length required for each numeric type. This way programs don't need to
roll their own.

christos