cc-3473: use euid in airtime-check-system
This commit is contained in:
parent
9e816df587
commit
6e127bbfdc
1 changed files with 2 additions and 1 deletions
|
@ -32,8 +32,9 @@ class AirtimeCheck {
|
||||||
public static function ExitIfNotRoot()
|
public static function ExitIfNotRoot()
|
||||||
{
|
{
|
||||||
// Need to check that we are superuser before running this.
|
// Need to check that we are superuser before running this.
|
||||||
|
$euid = posix_geteuid();
|
||||||
$user = posix_getlogin();
|
$user = posix_getlogin();
|
||||||
if($user != "root" && $user != "www-data"){
|
if($euid != 0 && $user != "www-data"){
|
||||||
echo "Must be root user.\n";
|
echo "Must be root user.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue