CC-2797: Files in /etc/airtime should not be world readable
-fixed
This commit is contained in:
parent
1ba200441e
commit
1b165f473c
6 changed files with 95 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
AirtimeCheck::ExitIfNotRoot();
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
|
||||
//detect if we are running via the command line
|
||||
|
@ -67,6 +69,20 @@ class AirtimeCheck {
|
|||
const PYINOTIFY_MIN_VERSION = "0.9.2";
|
||||
|
||||
public static $check_system_ok = true;
|
||||
|
||||
/**
|
||||
* Ensures that the user is running this PHP script with root
|
||||
* permissions. If not running with root permissions, causes the
|
||||
* script to exit.
|
||||
*/
|
||||
public static function ExitIfNotRoot()
|
||||
{
|
||||
// Need to check that we are superuser before running this.
|
||||
if(exec("whoami") != "root"){
|
||||
echo "Must be root user.\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static function CheckAirtimeDaemonRunning($filename, $process_id_str, $process_running_str, $name, $logFile)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue