diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-08-20 00:31:15 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-08-20 00:31:15 +0000 |
commit | 2d1dc97298f14244165efe1fde7555434351a8c4 (patch) | |
tree | 37d4d73b17f9f84509c6cdbe7fc8cd0d32e17ae5 /packages | |
parent | 54343914d2b05a9963e48b9baa62445c31c2d6fc (diff) | |
download | pfsense-packages-2d1dc97298f14244165efe1fde7555434351a8c4.tar.gz pfsense-packages-2d1dc97298f14244165efe1fde7555434351a8c4.tar.bz2 pfsense-packages-2d1dc97298f14244165efe1fde7555434351a8c4.zip |
Stop playing ro/rw games with dashboard files.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/dashboard/dashboard.inc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/dashboard/dashboard.inc b/packages/dashboard/dashboard.inc index f6752f14..86097eaa 100644 --- a/packages/dashboard/dashboard.inc +++ b/packages/dashboard/dashboard.inc @@ -2,7 +2,7 @@ function dashboard_install() { global $g, $config; - mwexec("chmod ug+rw /usr/local/www/index.php"); + assign_privs(); if(!file_exists("/usr/local/www/index.php.before_dashboard")) { /* backup the pre-dashboard index.php file */ mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); @@ -10,20 +10,25 @@ function dashboard_install() { mwexec("cp /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard"); } mwexec("tar xzvpf /usr/local/pkg/widgets.tgz -C /usr/local/www/"); - mwexec("chmod a-w /usr/local/www/index.php"); - mwexec("chmod a-w /usr/local/www/fbegin.php"); - mwexec("chmod a-w /usr/local/www/graph_cpu.php"); - mwexec("chmod a-w /usr/local/www/stats.php"); + assign_privs(); } function dashboard_deinstall() { global $g, $config; - mwexec("chmod ug+rw /usr/local/www/index.php"); + assign_privs(); if(file_exists("/usr/local/www/index.php.before_dashboard")) { /* restore the files prior to the dashboard package installation */ mwexec("cp /usr/local/www/index.php.before_dashboard /usr/local/www/index.php"); mwexec("cp /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc"); } + assign_privs(); +} + +function assign_privs() { + mwexec("chmod a+rw /usr/local/www/index.php"); + mwexec("chmod a+rw /usr/local/www/fbegin.php"); + mwexec("chmod a+rw /usr/local/www/graph_cpu.php"); + mwexec("chmod a+rw /usr/local/www/stats.php"); } ?>
\ No newline at end of file |