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,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
exitIfNotRoot();
|
||||
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
// Name of the web server user
|
||||
|
@ -65,4 +68,17 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){
|
|||
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray);
|
||||
$result = curl_exec($ch);
|
||||
}
|
||||
?>
|
||||
|
||||
/**
|
||||
* Ensures that the user is running this PHP script with root
|
||||
* permissions. If not running with root permissions, causes the
|
||||
* script to exit.
|
||||
*/
|
||||
function exitIfNotRoot()
|
||||
{
|
||||
// Need to check that we are superuser before running this.
|
||||
if(exec("whoami") != "root"){
|
||||
echo "Must be root user.\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue