summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-07-01 11:38:20 -0400
committerjim-p <jimp@pfsense.org>2011-07-01 11:38:20 -0400
commit2488a7e73a1527445f23b97d30cde74d1bb74738 (patch)
treefc17367994edbe8b94232b864e85942ca73ec651
parentda70dc36adf11666d92ab109c564c76103a3ebac (diff)
parent0fcaf4f2723c7defa1f8cd13ac3ba63c73a9d77d (diff)
downloadpfsense-2488a7e73a1527445f23b97d30cde74d1bb74738.zip
pfsense-2488a7e73a1527445f23b97d30cde74d1bb74738.tar.gz
Merge remote branch 'upstream/master'
-rw-r--r--etc/inc/auth.inc16
-rw-r--r--etc/inc/captiveportal.inc2
-rw-r--r--etc/inc/interfaces.inc32
-rw-r--r--etc/inc/services.inc32
-rw-r--r--etc/inc/shaper.inc2
-rw-r--r--etc/inc/upgrade_config.inc10
-rwxr-xr-xetc/rc.linkup8
-rwxr-xr-xetc/rc.newwanip17
-rw-r--r--usr/local/www/status_captiveportal_test.php3
-rw-r--r--usr/local/www/system_certmanager.php8
10 files changed, 74 insertions, 56 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 8dc0fe7..ae4a8f3 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -200,9 +200,11 @@ function & getUserEntry($name) {
function & getUserEntryByUID($uid) {
global $debug, $config;
- foreach ($config['system']['user'] as & $user)
- if ($user['uid'] == $uid)
- return $user;
+
+ if (is_array($config['system']['user']))
+ foreach ($config['system']['user'] as & $user)
+ if ($user['uid'] == $uid)
+ return $user;
return false;
}
@@ -215,9 +217,11 @@ function & getGroupEntry($name) {
function & getGroupEntryByGID($gid) {
global $debug, $config;
- foreach ($config['system']['group'] as & $group)
- if ($group['gid'] == $gid)
- return $group;
+
+ if (is_array($config['system']['group']))
+ foreach ($config['system']['group'] as & $group)
+ if ($group['gid'] == $gid)
+ return $group;
return false;
}
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index e54413c..ce0435d 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -413,7 +413,7 @@ function captiveportal_init_webgui() {
$key = base64_decode($config['captiveportal']['private-key']);
/* generate lighttpd configuration */
system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal-SSL.conf",
- $cert, $key, $cacert, "lighty-CaptivePortal-ssl.pid", "8001", "/usr/local/captiveportal/",
+ $cert, $key, $cacert, "lighty-CaptivePortal-SSL.pid", "8001", "/usr/local/captiveportal/",
"cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index ecbb504..4bbc4ac 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -4062,4 +4062,36 @@ function get_vip_descr($ipaddress) {
return "";
}
+function interfaces_staticarp_configure($if) {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "interfaces_staticarp_configure($if) being called $mt\n";
+ }
+
+ $ifcfg = $config['interfaces'][$if];
+
+ if (empty($if) || empty($ifcfg['if']))
+ return 0;
+
+ /* Enable staticarp, if enabled */
+ if(isset($config['dhcpd'][$if]['staticarp'])) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
+ mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
+ if (is_array($config['dhcpd'][$if]['staticmap'])) {
+
+ foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
+ mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
+
+ }
+
+ }
+ } else {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
+ mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
+ }
+
+ return 0;
+}
+
?>
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index d800859..88c69b7 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -913,38 +913,6 @@ EOD;
return 0;
}
-function interfaces_staticarp_configure($if) {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "interfaces_staticarp_configure($if) being called $mt\n";
- }
-
- $ifcfg = $config['interfaces'][$if];
-
- if (empty($if) || empty($ifcfg['if']))
- return 0;
-
- /* Enable staticarp, if enabled */
- if(isset($config['dhcpd'][$if]['staticarp'])) {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
- mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
- if (is_array($config['dhcpd'][$if]['staticmap'])) {
-
- foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
- mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
-
- }
-
- }
- } else {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
- mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
- }
-
- return 0;
-}
-
function services_dhcrelay_configure() {
global $config, $g;
if(isset($config['system']['developerspew'])) {
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index c9f41f3..9d9868b 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -382,7 +382,7 @@ class altq_root_queue {
function &get_queue_list($q = null) {
$qlist = array();
- $qlist[$this->GetQname()] = & $this;
+ //$qlist[$this->GetQname()] = & $this;
if (is_array($this->queues)) {
foreach ($this->queues as $queue)
$queue->get_queue_list(&$qlist);
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 0fa3b37..f8e3439 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1341,6 +1341,8 @@ function upgrade_048_to_049() {
$all['gid'] = 1998;
$all['member'] = array();
+ if (!is_array($config['system']['user']))
+ $config['system']['user'] = array();
if (!is_array($config['system']['group']))
$config['system']['group'] = array();
@@ -1392,6 +1394,9 @@ function upgrade_048_to_049() {
function upgrade_049_to_050() {
global $config;
+
+ if (!is_array($config['system']['user']))
+ $config['system']['user'] = array();
/* update user privileges */
foreach ($config['system']['user'] as & $user) {
$privs = array();
@@ -2098,6 +2103,7 @@ function upgrade_055_to_056() {
function upgrade_056_to_057() {
global $config;
+
if (!is_array($config['system']['user']))
$config['system']['user'] = array();
/* migrate captivate portal to user manager */
@@ -2449,9 +2455,9 @@ function upgrade_070_to_071() {
function rename_field(& $section, $oldname, $newname) {
if (is_array($section)) {
foreach($section as & $item) {
- if (!empty($item[$oldname]))
+ if (is_array($item) && !empty($item[$oldname]))
$item[$newname] = $item[$oldname];
- if (isset($item[$oldname]))
+ if (is_array($item) && isset($item[$oldname]))
unset($item[$oldname]);
}
}
diff --git a/etc/rc.linkup b/etc/rc.linkup
index ea0fb90..23d7c9b 100755
--- a/etc/rc.linkup
+++ b/etc/rc.linkup
@@ -42,9 +42,9 @@ function handle_argument_group($iface, $argument2) {
$ipaddr = $config['interfaces'][$iface]['ipaddr'];
if (is_ipaddr($ipaddr) || empty($ipaddr)) {
log_error("Hotplug event detected for {$iface} but ignoring since interface is configured with static IP ({$ipaddr})");
+ interfaces_staticarp_configure($iface);
$iface = get_real_interface($iface);
interfaces_bring_up($iface);
- exec("/usr/sbin/arp -d -i {$iface} -a");
if ($argument2 == "start" || $argument2 == "up")
send_event("interface newip {$iface}");
} else {
@@ -56,16 +56,14 @@ function handle_argument_group($iface, $argument2) {
break;
case "start":
log_error("DEVD Ethernet attached event for {$iface}");
- $riface = get_real_interface($iface);
- exec("/usr/sbin/arp -d -i {$riface} -a");
+ interfaces_staticarp_configure($iface);
log_error("HOTPLUG: Configuring interface {$iface}");
// Do not try to readd to bridge otherwise em(4) has problems
interface_configure($iface, false, true);
break;
case "up":
log_error("DEVD Ethernet attached event for {$iface}");
- $riface = get_real_interface($iface);
- exec("/usr/sbin/arp -d -i {$riface} -a");
+ interfaces_staticarp_configure($iface);
log_error("HOTPLUG: Configuring interface {$iface}");
interface_configure($iface);
break;
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index ad3a54d..fc8c802 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -89,16 +89,25 @@ $oldip = "0.0.0.0";
if (file_exists("{$g['vardb_path']}/{$interface}_cacheip"))
$oldip = file_get_contents("{$g['vardb_path']}/{$interface}_cacheip");
-$grouptmp = link_interface_to_group($interface);
-if (!empty($grouptmp))
- array_walk($grouptmp, 'interface_group_add_member');
-
/* regenerate resolv.conf if DNS overrides are allowed */
system_resolvconf_generate(true);
/* write current WAN IP to file */
file_put_contents("{$g['vardb_path']}/{$interface}_ip", $curwanip);
+unset($gre);
+$gre = link_interface_to_gre($interface);
+if (!empty($gre))
+ array_walk($gre, 'interface_gre_configure');
+unset($gif);
+$gif = link_interface_to_gif($interface);
+if (!empty($gif))
+ array_walk($gif, 'interface_gif_configure');
+
+$grouptmp = link_interface_to_group($interface);
+if (!empty($grouptmp))
+ array_walk($grouptmp, 'interface_group_add_member');
+
/* reconfigure static routes (kernel may have deleted them) */
system_routing_configure($interface);
diff --git a/usr/local/www/status_captiveportal_test.php b/usr/local/www/status_captiveportal_test.php
index c6d1dab..576a019 100644
--- a/usr/local/www/status_captiveportal_test.php
+++ b/usr/local/www/status_captiveportal_test.php
@@ -42,9 +42,10 @@ require("shaper.inc");
require("captiveportal.inc");
require_once("voucher.inc");
+$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Test Vouchers"));
+
include("head.inc");
include("fbegin.inc");
-$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Test Vouchers"));
?>
<form action="status_captiveportal_test.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 6b0d81e..1fd7323 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -592,25 +592,25 @@ function internalca_change() {
<tr>
<td align="right"><?=gettext("Country Code");?> : &nbsp;</td>
<td align="left">
- <input name="dn_country" type="text" class="formfld unknown" maxlength="2" size="2" value="<?=htmlspecialchars($pconfig['dn_country']);?>" readonly/>
+ <input name="dn_country" type="text" class="formfld unknown" maxlength="2" size="2" value="<?=htmlspecialchars($pconfig['dn_country']);?>"/>
</td>
</tr>
<tr>
<td align="right"><?=gettext("State or Province");?> : &nbsp;</td>
<td align="left">
- <input name="dn_state" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_state']);?>" readonly/>
+ <input name="dn_state" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_state']);?>"/>
</td>
</tr>
<tr>
<td align="right"><?=gettext("City");?> : &nbsp;</td>
<td align="left">
- <input name="dn_city" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_city']);?>" readonly/>
+ <input name="dn_city" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_city']);?>"/>
</td>
</tr>
<tr>
<td align="right"><?=gettext("Organization");?> : &nbsp;</td>
<td align="left">
- <input name="dn_organization" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_organization']);?>" readonly/>
+ <input name="dn_organization" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_organization']);?>"/>
</td>
</tr>
<tr>
OpenPOWER on IntegriCloud