aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-02-26 04:35:32 +0000
committerColin Smith <colin@pfsense.org>2005-02-26 04:35:32 +0000
commit90c54d668f3b0c5bcd7767e11da5aa1479b4861f (patch)
tree397d3c5489f7bf4e2c1e8aedcde8e4ab0bcf624f
parent0f57225f3c0364ae17ccc5a79d18dd719e7e4658 (diff)
downloadpfsense-packages-90c54d668f3b0c5bcd7767e11da5aa1479b4861f.tar.gz
pfsense-packages-90c54d668f3b0c5bcd7767e11da5aa1479b4861f.tar.bz2
pfsense-packages-90c54d668f3b0c5bcd7767e11da5aa1479b4861f.zip
* Add config locking and remounting.
* FreeRADIUS typo correction. * Change <name> in powerdns.xml: nmap -> powerdns
-rw-r--r--packages/carp.xml4
-rw-r--r--packages/freeradius.xml4
-rw-r--r--packages/freeradiusclients.xml4
-rw-r--r--packages/freeradiussettings.xml5
-rw-r--r--packages/ifstated.xml4
-rw-r--r--packages/ntop/ntop.xml4
-rw-r--r--packages/pfstat.xml4
-rw-r--r--packages/powerdns.xml6
-rw-r--r--packages/pure-ftpd.xml4
-rw-r--r--packages/pure-ftpdsettings.xml4
-rw-r--r--packages/squid.xml4
-rw-r--r--packages/stunnel.xml4
12 files changed, 49 insertions, 2 deletions
diff --git a/packages/carp.xml b/packages/carp.xml
index db8d8ca5..8b5fbce4 100644
--- a/packages/carp.xml
+++ b/packages/carp.xml
@@ -226,6 +226,8 @@
* XXX: find out how many carp and pfsync interfaces are established
* and destroy/down them before sweeping through the list
*/
+ conf_mount_rw();
+ config_lock();
$fout = fopen("/usr/local/etc/rc.d/carp.sh","w");
fwrite($fout, "#!/bin/sh \n");
global $config;
@@ -269,6 +271,8 @@
mwexec("/usr/local/etc/rc.d/carp.sh");
if($using_arp_balance == 1) system("sysctl net.inet.arpbalance=1");
if($preempt == 1) system("sysctl net.inet.carp.preempt=1");
+ conf_mount_ro();
+ config_unlock();
}
</custom_php_command_before_form>
<custom_php_resync_config_command>
diff --git a/packages/freeradius.xml b/packages/freeradius.xml
index 4d8c7588..d646cedb 100644
--- a/packages/freeradius.xml
+++ b/packages/freeradius.xml
@@ -77,6 +77,8 @@
<custom_php_command_before_form>
function sync_package()
{
+ conf_mount_rw();
+ config_lock();
global $config;
$fout = fopen("/usr/local/etc/raddb/users","w");
fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
@@ -86,6 +88,8 @@
}
}
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("/usr/bin/killall -HUP radiusd");
}
</custom_php_command_before_form>
diff --git a/packages/freeradiusclients.xml b/packages/freeradiusclients.xml
index b1fbcbf0..d26b792a 100644
--- a/packages/freeradiusclients.xml
+++ b/packages/freeradiusclients.xml
@@ -59,6 +59,8 @@
</fields>
<custom_php_command_before_form>
function sync_package() {
+ conf_mount_rw();
+ config_lock();
global $config;
$fout = fopen("/usr/local/etc/raddb/clients.conf","w");
fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
@@ -69,6 +71,8 @@
}
}
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("killall -HUP radiusd");
}
sync_package();
diff --git a/packages/freeradiussettings.xml b/packages/freeradiussettings.xml
index 5ef05756..ac157dc2 100644
--- a/packages/freeradiussettings.xml
+++ b/packages/freeradiussettings.xml
@@ -34,6 +34,8 @@
</fields>
<custom_php_command_before_form>
function sync_package() {
+ conf_mount_rw();
+ config_lock();
global $config;
$fout = fopen("/usr/local/etc/raddb/radiusd.conf.dynamic","w");
fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
@@ -49,9 +51,10 @@
fwrite($fout, "type = auth\n}\n\n");
fwrite($fout, "{\nipaddr = 127.0.0.1\nport = 0\ntype = auth\n}\n\n");
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
}
system("killall -HUP radiusd");
- sync_package();
</custom_php_command_before_form>
<custom_add_php_command>
sync_package();
diff --git a/packages/ifstated.xml b/packages/ifstated.xml
index 1c1dfecd..4be67694 100644
--- a/packages/ifstated.xml
+++ b/packages/ifstated.xml
@@ -68,6 +68,8 @@
mwexec("chmod a+x /usr/local/etc/rc.d/radiusd.sh");
</custom_php_install_command>
<custom_add_php_command>
+ conf_mount_rw();
+ config_lock();
global $config;
$fout = fopen("/usr/local/etc/ifstated.conf","w");
if($config['installedpackages']['ifstated']['config'] != "") {
@@ -82,6 +84,8 @@
fwrite($fout, "state backup {\ninit {\nrun \"ifconfig carp0 advskew 100\"\nrun \"ifconfig carp1 advskew 100\"\n}\nif ! \$carp_sync and \$net and \"sleep 5\" every 10 {\nif (! \$carp_sync) and \$net {\nset-state promoted\n}\n}\n}\n");
}
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
mwexec("/usr/bin/killall -HUP ifstated");
</custom_add_php_command>
</packagegui>
diff --git a/packages/ntop/ntop.xml b/packages/ntop/ntop.xml
index 5a59526b..56cc73cf 100644
--- a/packages/ntop/ntop.xml
+++ b/packages/ntop/ntop.xml
@@ -53,6 +53,8 @@
</field>
</fields>
<custom_add_php_command>
+ conf_mount_rw();
+ config_lock();
if($_POST['password'] == $_POST['passwordagain']) {
$interfaces = " -i ";
$ifaces=$_POST['iface'];
@@ -70,6 +72,8 @@
fwrite($fout, "#!/bin/sh\n\n");
fwrite($fout, "/usr/local/bin/ntop " . $interfaces . " -u root -d --ipv4 -M\n\n");
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("chmod 555 /usr/local/etc/rc.d/ntop.sh");
system("killall ntop 2>/dev/null");
system("/usr/local/etc/rc.d/ntop.sh");
diff --git a/packages/pfstat.xml b/packages/pfstat.xml
index 6e3fd70e..f95e5b19 100644
--- a/packages/pfstat.xml
+++ b/packages/pfstat.xml
@@ -206,6 +206,8 @@
</fields>
<custom_php_command_before_form>
function sync_package() {
+ conf_mount_rw();
+ config_lock();
global $config;
$fout = fopen("/usr/local/etc/pfstat.conf","w");
if($config['installedpackages']['pfstat']['config'] != "") {
@@ -250,6 +252,8 @@
}
}
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
}
sync_package();
</custom_php_command_before_form>
diff --git a/packages/powerdns.xml b/packages/powerdns.xml
index ce91b81b..5820c41c 100644
--- a/packages/powerdns.xml
+++ b/packages/powerdns.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
- <name>nmap</name>
+ <name>powerdns</name>
<version>2.9.16_4</version>
<title>Services: PowerDNS</title>
<donotsave>true</donotsave>
@@ -120,6 +120,8 @@
</custom_php_install_command>
<custom_add_php_command>
if($password == $passwordagain) {
+ conf_mount_rw();
+ config_lock();
$fd = popen("/usr/sbin/pw usermod -n pgsql -H 0", "w");
$salt = md5(time());
$crypted_pw = crypt($_POST['password'],$salt);
@@ -189,6 +191,8 @@
fwrite($fout, "# wildcard-url=no\n");
fwrite($fout, "# wildcards=\n");
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("/usr/local/bin/pg_ctl -m smart 2>/dev/null");
system("/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start 2>/dev/null");
} else {
diff --git a/packages/pure-ftpd.xml b/packages/pure-ftpd.xml
index 16427522..eeeda8cc 100644
--- a/packages/pure-ftpd.xml
+++ b/packages/pure-ftpd.xml
@@ -77,6 +77,8 @@
system("rm -rf /usr/local/etc/pure*");
</custom_php_deinstall_command>
<custom_add_php_command>
+ conf_mount_rw();
+ config_lock();
$expires = "";
if($_POST['expiration']) $expires = " -e " . $_POST['expiration'];
mwexec("/usr/sbin/pw useradd " . $_POST['username'] . $expires . " -m -k /home/ " . $_POST['username'] . " -s /usr/sbin/nologin");
@@ -85,6 +87,8 @@
$crypted_pw = crypt($_POST['password'],$salt);
fwrite($fd, $crypted_pw);
pclose($fd);
+ conf_mount_ro();
+ config_unlock();
$savemsg = "User has been added.";
</custom_add_php_command>
<custom_delete_php_command>
diff --git a/packages/pure-ftpdsettings.xml b/packages/pure-ftpdsettings.xml
index 111548c7..c6435347 100644
--- a/packages/pure-ftpdsettings.xml
+++ b/packages/pure-ftpdsettings.xml
@@ -81,6 +81,8 @@
<custom_php_deinstall_command>
</custom_php_deinstall_command>
<custom_add_php_command>
+ conf_mount_rw();
+ config_lock();
mwexec("rm /usr/local/etc/rc.d/pure-ftp*");
$fout = fopen("/usr/local/etc/rc.d/pure-ftpd.sh","w");
fwrite($fout, "#!/bin/sh\n\n");
@@ -95,6 +97,8 @@
$startline .= " -B /usr/local/etc/pure-ftpd.conf";
fwrite($fout, $startline . "\n");
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
mwexec("chmod a+x /usr/local/etc/rc.d/pure-ftpd.sh");
mwexec("/usr/local/etc/rc.d/pure-ftpd.sh");
</custom_add_php_command>
diff --git a/packages/squid.xml b/packages/squid.xml
index b583a896..f2eccb40 100644
--- a/packages/squid.xml
+++ b/packages/squid.xml
@@ -61,6 +61,8 @@
</fields>
<custom_php_command_before_form>
function sync_package() {
+ conf_mount_rw();
+ config_lock();
system("/bin/mkdir /usr/local/etc/squid 2>/dev/null");
$lancfg = $config['interfaces']['lan'];
$lanif = $lancfg['if'];
@@ -97,6 +99,8 @@
fwrite($fout, "#!/bin/sh\n");
fwrite($fout, "/usr/local/sbin/squid\n\n");
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("chmod a+x /usr/local/etc/rc.d/squid.sh");
system("/usr/local/sbin/squid -z");
system("/usr/local/sbin/squid");
diff --git a/packages/stunnel.xml b/packages/stunnel.xml
index 6cd26ec1..c07eea0e 100644
--- a/packages/stunnel.xml
+++ b/packages/stunnel.xml
@@ -87,6 +87,8 @@
system("rm -rf /usr/local/etc/stunnel*");
</custom_php_deinstall_command>
<custom_add_php_command_late>
+ conf_mount_rw();
+ config_lock();
$fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w");
fwrite($fout, "cert = /usr/local/etc/stunnel/mail.pem \n");
fwrite($fout, "chroot = /var/tmp/stunnel \n");
@@ -99,6 +101,8 @@
fwrite($fout, "TIMEOUTclose = 0\n\n");
}
fclose($fout);
+ conf_mount_ro();
+ config_unlock();
system("/usr/bin/killall stunnel 2>/dev/null");
system("/usr/local/etc/rc.d/stunnel.sh start 2>/dev/null");
</custom_add_php_command_late>