Merge branch '2.0.x' into devel

Conflicts:
	VERSION
	airtime_mvc/application/models/Systemstatus.php
	install_minimal/include/airtime-constants.php
	install_minimal/include/airtime-upgrade.php
	python_apps/api_clients/api_client.py
	python_apps/media-monitor/install/media-monitor-copy-files.py
	python_apps/media-monitor/install/media-monitor-initialize.py
	python_apps/pypo/install/pypo-initialize.py
	python_apps/pypo/liquidsoap_bin
	python_apps/pypo/pypopush.py
	utils/airtime-log.php
This commit is contained in:
Martin Konecny 2012-04-12 19:08:55 -04:00
commit f96b990275
23 changed files with 121 additions and 30 deletions

View file

@ -33,8 +33,9 @@ class AirtimeCheck {
public static function ExitIfNotRoot()
{
// Need to check that we are superuser before running this.
$user = exec("whoami");
if($user != "root" && $user != "www-data"){
$euid = posix_geteuid();
$user = posix_getlogin();
if($euid != 0 && $user != "www-data"){
echo "Must be root user.\n";
exit(1);
}

View file

@ -18,7 +18,7 @@ logging.disable(50)
# add ch to logger
logger.addHandler(ch)
if (commands.getoutput("whoami") != 'root'):
if (os.geteuid() != 0):
print 'Must be a root user.'
sys.exit()

View file

@ -30,7 +30,7 @@ array_filter($log_files, "file_exists");
function exitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
if(posix_geteuid() != 0){
echo "Must be root user.\n";
exit(1);
}

View file

@ -101,7 +101,7 @@ if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
function exitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
if(posix_geteuid() != 0){
echo "Must be root user.\n";
exit(1);
}