From 90c54d668f3b0c5bcd7767e11da5aa1479b4861f Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Sat, 26 Feb 2005 04:35:32 +0000 Subject: * Add config locking and remounting. * FreeRADIUS typo correction. * Change in powerdns.xml: nmap -> powerdns --- packages/carp.xml | 4 ++++ packages/freeradius.xml | 4 ++++ packages/freeradiusclients.xml | 4 ++++ packages/freeradiussettings.xml | 5 ++++- packages/ifstated.xml | 4 ++++ packages/ntop/ntop.xml | 4 ++++ packages/pfstat.xml | 4 ++++ packages/powerdns.xml | 6 +++++- packages/pure-ftpd.xml | 4 ++++ packages/pure-ftpdsettings.xml | 4 ++++ packages/squid.xml | 4 ++++ packages/stunnel.xml | 4 ++++ 12 files changed, 49 insertions(+), 2 deletions(-) (limited to 'packages') 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(); } 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 @@ 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"); } 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 @@ 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 @@ 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(); 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"); + 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"); 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 @@ + 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 @@ 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(); 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 @@ - nmap + powerdns 2.9.16_4 Services: PowerDNS true @@ -120,6 +120,8 @@ 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*"); + 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."; 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 @@ + 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"); 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 @@ 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*"); + 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"); -- cgit v1.2.3