diff --git a/rdo.c b/rdo.c index a81ae9b..80af53f 100644 --- a/rdo.c +++ b/rdo.c @@ -79,12 +79,16 @@ int main(int argc, char** argv) { return runprog(argc, argv); struct passwd* p = getpwnam(username); - if (!p) - err(1, "Could not get user info"); + if (!p) { + if (errno == 0) + errx(1, "The user specified in the config file does not exist."); + else + err(1, "Could not get user info"); + } int uid = p->pw_uid; if (uid != ruid && ruid != 0) - errx(1, "You are not in the username file"); + errx(1, "You are not allowed to execute rdo."); struct spwd* shadowEntry = getspnam(p->pw_name);