1
0
Fork 0
forked from soccera/rdo

Fix formatting in rdo.c

This commit is contained in:
sw1tchbl4d3 2021-07-13 22:46:57 +02:00
parent 604f5e7fdd
commit 3e4ffde3a4

7
rdo.c
View file

@ -10,8 +10,10 @@
void runprog(int argc, char** argv) {
for(int i=0; i<argc; i++)
argv[i] = argv[i + 1];
setuid(0);
setgid(0);
if (execvp(argv[0], argv) != 0)
perror(argv[0]);
}
@ -30,7 +32,7 @@ int main(int argc, char** argv) {
fclose(fp);
runprog(argc, argv);
return 0;
}
}
char username[64];
fgets(username, 64, fp);
@ -58,8 +60,9 @@ int main(int argc, char** argv) {
if (strcmp(shadowEntry->sp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) {
runprog(argc, argv);
return 0;
return 0;
}
fprintf(stderr, "Wrong password.\n");
tries++;
}