-
Notifications
You must be signed in to change notification settings - Fork 11
Get user name by getpwuid instead of environment variable USER #150
Conversation
Unit tests are failing. |
clang++ (not g++) on Ubuntu 22.04 LTS can use std::format. |
Coverage testing has failed. This is because it uses g++. Maybe Ubuntu 24.04 LTS will be available in a few months, so it's a not bad idea not to take action. |
I believe we would want |
I think that being available in various distributions, old and new, is not about being able to build, but about having binaries available. |
Thank you for information. I'm traveling for a couple of days. I'll take a look later. |
We'll also need to update the unit test images to 24.04. |
Update The OS version of |
Description
getlogin(2)
does not return the expected value.Instead,
getpwuid(3)
can be used to retrieve the user name.To test this, I've prepared a repository youpong/getuser.
See function
test_getlogin()
forgetlogin(2)
behavior, functiongetuser()
for an example implementation ingetpwuid(3)
.You can see the results of the multi-platform behavior in the GitHub Actions log.
Related Issue