diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-08-18 21:04:27 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-08-18 21:04:27 +0200 |
| commit | 1178e60adb70db64d1c543494f18d857c10df023 (patch) | |
| tree | f3ec61ac909b58e0adc26d441414df5da0573158 /src/cerberus.c | |
| parent | haiku (diff) | |
| download | cerberus-1178e60adb70db64d1c543494f18d857c10df023.tar.gz cerberus-1178e60adb70db64d1c543494f18d857c10df023.tar.bz2 cerberus-1178e60adb70db64d1c543494f18d857c10df023.tar.xz | |
getpwnam returns EIO if user does not exist
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
| -rw-r--r-- | src/cerberus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cerberus.c b/src/cerberus.c index 0310b76..3f2c539 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -364,10 +364,10 @@ void do_login(int argc, char** argv) /* Get user information */ if ((entry = getpwnam(username)) == NULL) { - if (errno) - perror("getpwnam"); - else + if (errno == EIO /* seriously...? */ || !errno) printf("User does not exist\n"); + else if (errno) + perror("getpwnam"); sleep(ERROR_SLEEP); _exit(1); } |
