diff --git a/src/tarantool.m b/src/tarantool.m index 91bc92cf0a0dc065196fd4d5a3605dac076b455b..e04d82251f490b4b90118ad236146c42ead3c5a6 100644 --- a/src/tarantool.m +++ b/src/tarantool.m @@ -775,8 +775,15 @@ main(int argc, char **argv) if (cfg.username != NULL) { if (getuid() == 0 || geteuid() == 0) { struct passwd *pw; + errno = 0; if ((pw = getpwnam(cfg.username)) == 0) { - say_syserror("getpwnam: %s", cfg.username); + if (errno) { + say_syserror("getpwnam: %s", + cfg.username); + } else { + say_error("User not found: %s", + cfg.username); + } exit(EX_NOUSER); } if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0 || seteuid(pw->pw_uid)) {