diff --git a/rdo.c b/rdo.c index 019310a..8cde84c 100644 --- a/rdo.c +++ b/rdo.c @@ -29,7 +29,7 @@ void getconf(FILE* fp, const char* entry, char* result, size_t len_result) { errx(1, "Could not get '%s' entry in config", entry); } -void runprog(int argc, char** argv) { +int runprog(int argc, char** argv) { for(int i=0; isp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) { - runprog(argc, argv); - return 0; - } + if (strcmp(shadowEntry->sp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) + return runprog(argc, argv); usleep(sleep_ms); fprintf(stderr, "Wrong password.\n");