diff --git a/rdo.c b/rdo.c index 3016396..16ff909 100644 --- a/rdo.c +++ b/rdo.c @@ -9,7 +9,7 @@ #include #include "sessions.h" -#define VERSION "1.2" +#define VERSION "1.3" void getconf(FILE* fp, const char* entry, char* result, size_t len_result) { char* line = NULL; @@ -96,7 +96,10 @@ int main(int argc, char** argv) { if (!readpassphrase("(rdo) Password: ", password, sizeof(password), RPP_REQUIRE_TTY)) err(1, "Could not get passphrase"); - if (strcmp(shadowEntry->sp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) { + int rc = strcmp(shadowEntry->sp_pwdp, crypt(password, shadowEntry->sp_pwdp)); + memset(password, 0, sizeof(password)); + + if (rc == 0) { setsession(getppid(), ts_ttl); return runprog(argc, argv); }