On Tue, Dec 4, 2012 at 1:27 PM, Jeff Layton <[email protected]> wrote:
> On Tue, 4 Dec 2012 10:45:19 -0500
> Scott Lovenberg <[email protected]> wrote:
>
>> On Tue, Dec 4, 2012 at 10:16 AM, Jeff Layton <[email protected]> wrote:
>> > Sergio Conrad reported a problem trying to set up an autofs map to do
>> > a krb5 mount. In his environment, many users have usernames that are
>> > comprised entirely of numbers. While that's a bit odd, POSIX apparently
>> > allows for it.
>> >
>> > The current code assumes that when a numeric argument is passed to one
>> > of the above options, that it's a uid or gid. Instead, try to treat the
>> > argument as a user or group name first, and only try to treat it as a
>> > number if that fails.
>> >
>> > Signed-off-by: Jeff Layton <[email protected]>
>>
>> Yuck.  What happens when a number is both a valid user name and uid?
>> IE, I add a user named "0" (uid=5001).  Does getpwnam() return root
>> (uid=0) or 0 (uid=5001)?
>>
>
> You'd get back uid=5001:
>
>        The getpwnam() function returns a pointer to a structure containing the
>        broken-out  fields  of  the  record in the password database (e.g., the
>        local password file /etc/passwd, NIS, and LDAP) that matches the  user‐
>        name name.
>
> If you wanted to get back a struct passwd for uid=0 then you'd need to
> use getpwuid() there.
>
> --
> Jeff Layton <[email protected]>

I missed that; thanks for clarifying.

-- 
Peace and Blessings,
-Scott.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to