Order of getpwnam call in Get_Pwnam_internals

Alexander Bokovoy ab at samba.org
Thu Jan 25 14:52:36 UTC 2024


On Чцв, 25 сту 2024, hhyy ww via samba-technical wrote:
> Hi List,
> 
> I have a question about this commit
> https://git.samba.org/?p=samba.git;a=commitdiff;h=ea4a0d509ef70e91baedc5eebf4f4bcff10dac96
> 
> Why samba change the the order of getpwnam call from
> origin->lowercase->uppercase to lowercase->origin->uppercase?
> 
> Without this commit, what kind of problem will heppen?

In a POSIX environment usernames are in case-sensitive. On
Windows side names are not case-sensitive. RPC calls from
Windows systems would pass in a name as it was entered by a user and
that needs some normalization to be able to match it since POSIX API has
no way to search case-insensitive. Typical POSIX (Linux) environments
have names in low case, thus the code tries to optimize at source for
most common use case.

-- 
/ Alexander Bokovoy



More information about the samba-technical mailing list