1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-14 23:33:23 +00:00

getpwuid() errno

This commit is contained in:
Gerhard 2025-02-10 19:42:22 +01:00
parent 7b26406d96
commit 264b21c1a9
2 changed files with 9 additions and 2 deletions

View file

@ -3944,8 +3944,12 @@ int applyopt_spec(
{
struct passwd *pwd;
if ((pwd = getpwuid(opt->value.u_uidt)) == NULL) {
Error1("getpwuid("F_uid"): no such user",
opt->value.u_uidt);
if (errno != 0)
Error2("getpwuid("F_uid"): %s",
opt->value.u_uidt, strerror(errno));
else
Error1("getpwuid("F_uid"): no such user",
opt->value.u_uidt);
return -1;
}
if (Initgroups(pwd->pw_name, pwd->pw_gid) < 0) {