|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
@ -56,9 +57,18 @@ void clean() {
|
|
|
|
|
|
|
|
|
|
void runAndClean(const char *env[], const char *arg[]) {
|
|
|
|
|
int pid = fork();
|
|
|
|
|
if (pid == 0) execve("/usr/bin/pkexec", arg, env);
|
|
|
|
|
if (pid == 0) {
|
|
|
|
|
int res = execve("/usr/bin/pkexec", arg, env);
|
|
|
|
|
/*if (res == -1) {
|
|
|
|
|
print("[Pwnkit] Failed to execute pkexec, or it returned an error; your system is most likely patched!");
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
waitpid(pid, NULL, 0);
|
|
|
|
|
int status;
|
|
|
|
|
waitpid(pid, &status, 0);
|
|
|
|
|
if (WEXITSTATUS(status) == 126) {
|
|
|
|
|
print("[Pwnkit] Failed to execute pkexec, or it returned an error; your system is most likely patched!");
|
|
|
|
|
}
|
|
|
|
|
print("[Pwnkit] Cleaning up..");
|
|
|
|
|
clean();
|
|
|
|
|
}
|
|
|
|
|