1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-31 07:51:08 +03:00

fix 'unknow user' error from getpwnam/getgrnam

This commit is contained in:
Marco d'Itri 2006-08-20 18:21:50 +02:00 committed by Kay Sievers
parent c472055c90
commit 3770f6093f

View File

@ -99,7 +99,7 @@ uid_t lookup_user(const char *user)
pw = getpwnam(user);
if (pw == NULL) {
if (errno == 0)
if (errno == 0 || errno == ENOENT || errno == ESRCH)
err("specified user unknown '%s'", user);
else
err("error resolving user '%s': %s", user, strerror(errno));
@ -116,7 +116,7 @@ gid_t lookup_group(const char *group)
gr = getgrnam(group);
if (gr == NULL) {
if (errno == 0)
if (errno == 0 || errno == ENOENT || errno == ESRCH)
err("specified group unknown '%s'", group);
else
err("error resolving group '%s': %s", group, strerror(errno));