get_group_creds is returning -ESRCH upon error. The name of this error code sounds reasonable, but the error string is "No such process". This is a confusing error message for looking up a user group name. The same problem exists for the functions get_user_creds() and get_home_dir(). We ran into this error during boot-up: systemd-journald: Failed to resolve 'systemd-journal' group: No such process I ended up downloading the source of systemd to see if it was talking about a cgroup or a user group. Instead of ESRCH, I'd suggest ENOENT. There doesn't seem to be a perfect error code for this, but ESRCH is not a good choice in my opinion.
Well, the underlying getpwuid() tends to return ESRCH too, and in many cases we just pass that on (see getpwuid(3)). I am not sure it's such a good idea to tape over that...
I see what you're saying, but on the other hand, getpwuid can also return ENOENT in the event that it can't find the user name. And seeing as how this error ends up getting display to a user, I think "papering over" may not be a bad choice here. "no such process" is completely misleading and confusing.
But "No such file or directory" is misleading too. Users are neither files nor directories nor processes... Sounds wrong replacing one misleading error code with another misleading error code...
Good point. In that case, maybe doing some interpretation of the error code rather than using perror (or strerror_r, etc.) to print the error message.
The problem is actually that NSS modules can return whatever they want, and they are not very good at sticking to clear rules when to return what.
Honestly, I am not sure we can fix this really. NSS modules can return whatever they want, and we shouldn't try to hide the precise errors. If this should be fixed, then please fix it in glibc.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.