Skip to content

Conversation

mxpv
Copy link

@mxpv mxpv commented Aug 21, 2025

Closes: #23658

In current implementation, posixGetUserInfo parses /etc/passwd, which is insufficient in certain environments where accounts might be stored elsewhere (LDAP, Directory Services on macOS, etc.)

This PR uses getpwnam when linking against libc (and fallbacks to the original implementation), which offers more advanced (OS specific) capabilities under the hood.

@mxpv mxpv force-pushed the user branch 2 times, most recently from 99a7b6a to b7e8390 Compare August 21, 2025 16:19
@mxpv
Copy link
Author

mxpv commented Aug 21, 2025

Fixed test + rebased.
@alexrp could you pls retrigger CI?

@mxpv
Copy link
Author

mxpv commented Aug 21, 2025

oh, I see.

error: type '*void' does not support field access
            .uid = passwd.uid,

getpwnam might be available, but passwd struct can be reduced to void on certain platforms. I've added 753c8ae to address this case.

mxpv added 3 commits August 21, 2025 15:09
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
@mxpv
Copy link
Author

mxpv commented Aug 26, 2025

@alexrp could you pls take a look? Anything else I could do to get it going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std.process.getUserInfo not work for macOS
1 participant