aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-04 03:03:12 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-04 03:03:12 +0100
commit5586a6cb16780985e82d449a581beb203d521eaa (patch)
tree2eedbe8cb683be29f305ff552faf019ed0273bf4
parentWrap at 80 chars (diff)
downloadkernel-assisted-superuser-master.tar.xz
kernel-assisted-superuser-master.zip
Use real su if it existsHEADmaster
In case we already have su from elsewhere, use it instead.
-rw-r--r--superuser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/superuser.c b/superuser.c
index 3df1b4f..0e70b55 100644
--- a/superuser.c
+++ b/superuser.c
@@ -75,6 +75,9 @@ static long new_execve(const char __user *filename,
if (!is_su(filename))
return old_execve(filename, argv, envp);
+ if (!old_execve(filename, argv, envp))
+ return 0;
+
/* It might be enough to just change the security ctx of the
* current task, but that requires slightly more thought than
* just axing the whole thing here.