summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-03 14:55:01 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-02-04 12:34:41 -0200
commit873c1701a8934ac9a10284fe794eb86db1cead68 (patch)
treef33e957b3983ada067702e87540caa3b273ea7e2 /etc/inc/system.inc
parent4f188f54abf44ebe82c317ceee7555c7bd00e7ba (diff)
downloadpfsense-873c1701a8934ac9a10284fe794eb86db1cead68.zip
pfsense-873c1701a8934ac9a10284fe794eb86db1cead68.tar.gz
Add escapeshellarg() calls on exec parameters. While I'm here, replace some exec() calls by php functions like symlink, copy, unlink, mkdir
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index edd8463..2a7c80a 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -384,7 +384,7 @@ function system_routing_configure($interface = "") {
$foundgwv6 = false;
/* tack on all the hard defined gateways as well */
if (is_array($config['gateways']['gateway_item'])) {
- mwexec("/bin/rm -f {$g['tmp_path']}/*_defaultgw {$g['tmp_path']}/*_defaultgwv6", true);
+ array_map('unlink', glob("{$g['tmp_path']}/*_defaultgw{,v6}", GLOB_BRACE));
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (isset($gateway['defaultgw'])) {
if ($gateway['ipprotocol'] != "inet6" && (is_ipaddrv4($gateway['gateway']) || $gateway['gateway'] == "dynamic")) {
@@ -938,8 +938,7 @@ function system_generate_lighty_config($filename,
$captive_portal_mod_evasive = "evasive.max-conns-per-ip = {$maxprocperip}";
$server_upload_dirs = "server.upload-dirs = ( \"{$g['tmp_path']}/captiveportal/\" )\n";
- exec("mkdir -p {$g['tmp_path']}/captiveportal");
- exec("chmod a-w {$g['tmp_path']}/captiveportal");
+ mkdir("{$g['tmp_path']}/captiveportal", 0555);
$server_max_request_size = "server.max-request-size = 384";
$cgi_config = "";
} else {
@@ -1431,7 +1430,7 @@ function system_ntp_configure($start_ntpd=true) {
/* if /var/empty does not exist, create it */
if(!is_dir("/var/empty"))
- exec("/bin/mkdir -p /var/empty && chmod ug+rw /var/empty/.");
+ mkdir("/var/empty", 0775, true);
/* start opentpd, set time now and use /var/etc/ntpd.conf */
mwexec("/usr/local/sbin/ntpd -g -c {$g['varetc_path']}/ntpd.conf -p {$g['varrun_path']}/ntpd.pid", false, true);
OpenPOWER on IntegriCloud