CC-3573: Use posix_geteuid instead of "whoami" to detect who is running PHP script
-done
This commit is contained in:
parent
61c5c839dd
commit
c66f0c783f
12 changed files with 12 additions and 12 deletions
|
@ -32,7 +32,7 @@ class AirtimeCheck {
|
|||
public static function ExitIfNotRoot()
|
||||
{
|
||||
// Need to check that we are superuser before running this.
|
||||
$user = exec("whoami");
|
||||
$user = posix_getlogin();
|
||||
if($user != "root" && $user != "www-data"){
|
||||
echo "Must be root user.\n";
|
||||
exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue