summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-06-23 08:18:19 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-06-23 08:18:19 -0300
commit71f6dd50a0a711321ecf61f31d3d7db1205153cd (patch)
tree0770fbed24e8454b906bd91840ddf1f41dd46aa9
parent610d960ec988c76419742973e3339a1e9cf3bc22 (diff)
parentdbe8c192179edaf68a7efbc0eae3c735be671df1 (diff)
downloadpfsense-71f6dd50a0a711321ecf61f31d3d7db1205153cd.zip
pfsense-71f6dd50a0a711321ecf61f31d3d7db1205153cd.tar.gz
Merge remote branch 'mainline/master'
-rw-r--r--etc/inc/auth.inc2
-rw-r--r--etc/inc/globals.inc2
-rw-r--r--etc/inc/gwlb.inc8
-rw-r--r--etc/inc/pfsense-utils.inc2
-rw-r--r--etc/inc/upgrade_config.inc14
-rw-r--r--etc/inc/util.inc4
-rwxr-xr-xetc/sshd10
-rw-r--r--usr/local/www/interfaces_ppps.php2
-rwxr-xr-xusr/local/www/system_firmware_auto.php16
-rwxr-xr-xusr/local/www/system_firmware_check.php11
-rw-r--r--usr/local/www/system_usermanager.php12
11 files changed, 62 insertions, 21 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index f9b9d21..3a72db9 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -409,7 +409,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to remove */
foreach ($cur_groups as $groupname) {
if (in_array($groupname,$new_groups))
- continue;
+ continue;
$group = & $config['system']['group'][$groupindex[$groupname]];
$index = array_search($user['uid'], $group['member']);
array_splice($group['member'], $index, 1);
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index 6e2b1f6..dae4ea7 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -124,7 +124,7 @@ if(file_exists("/etc/platform")) {
$arch = trim(`uname -m`);
$g['platform'] = trim(file_get_contents("/etc/platform"));
if($g['platform'] == "nanobsd") {
- $g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_0/{$arch}/pfSense_HEAD/.updaters/";
+ $g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_1/{$arch}/pfSense_HEAD/.updaters/";
$g['update_manifest']="http://updates.pfSense.com/nanobsd/manifest";
$g['firmware_update_text']="pfSense-*.img.gz";
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 59c42b6..94ddd17 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -49,9 +49,6 @@ function setup_gateways_monitor() {
$a_settings['losslow'] = "10";
$a_settings['losshigh'] = "20";
- /* kill apinger process */
- if(is_process_running("apinger"))
- mwexec("/usr/bin/killall apinger", true);
$fd = fopen("{$g['varetc_path']}/apinger.conf", "w");
$apingerconfig = <<<EOD
@@ -238,7 +235,9 @@ EOD;
fwrite($fd, $apingerconfig);
fclose($fd);
- if(!is_process_running("apinger")) {
+ if (is_process_running("apinger")) {
+ sigkillbypid("{$g['varrun_path']}/apinger.pid", "HUP");
+ } else {
if (is_dir("{$g['tmp_path']}"))
chmod("{$g['tmp_path']}", 01777);
if (is_dir("{$g['vardb_path']}/rrd"))
@@ -246,6 +245,7 @@ EOD;
/* start a new apinger process */
mwexec_bg("/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf");
}
+
return 0;
}
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 17c7e67..e3eef07 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1810,7 +1810,7 @@ function pfs_version_compare($cur_time, $cur_text, $remote) {
if ($v === FALSE) {
// If that fails, try to compare by string
// Before anything else, simply test if the strings are equal
- if ($cur_text == $remote)
+ if (($cur_text == $remote) || ($cur_time == $remote))
return 0;
list($cur_num, $cur_str) = explode('-', $cur_text);
list($rem_num, $rem_str) = explode('-', $remote);
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 50b6ad0..104d5ac 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1619,6 +1619,9 @@ function upgrade_053_to_054() {
$lbpool_srv_arr = array();
$gateway_group_arr = array();
$gateways = return_gateways_array();
+ if (is_array($config['gateways']['gateway_item']))
+ $config['gateways']['gateway_item'] = array();
+ $a_gateways =& $config['gateways']['gateway_item'];
foreach($lbpool_arr as $lbpool) {
if($lbpool['type'] == "gateway") {
$gateway_group['name'] = $lbpool['name'];
@@ -1630,13 +1633,14 @@ function upgrade_053_to_054() {
$split = split("\|", $member);
$interface = $split[0];
$monitor = $split[1];
- if(is_ipaddr($monitor)) {
- $config['interfaces'][$interface]['monitorip'] = "$monitor";
- }
/* on static upgraded configuration we automatically prepend GW_ */
$static_name = "GW_" . strtoupper($interface);
- if(is_array($gateways[$static_name])) {
+ if(is_ipaddr($monitor)) {
$interface = $static_name;
+ if(is_array($gateways[$static_name]) && isset($gateways[$static_name]['attribute']))
+ $a_gateways[$gateways[$static_name]['attribute']]['monitor'] = $monitor;
+ else
+ $config['interfaces'][$interface]['monitorip'] = $monitor;
}
/* on failover increment tier. Else always assign 1 */
if($lbpool['behaviour'] == "failover") {
@@ -2064,4 +2068,4 @@ function upgrade_063_to_064() {
}
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 32846aa..9d5872e 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -50,9 +50,9 @@ function isvalidpid($pid) {
}
function is_process_running($process) {
- $running = (shell_exec("/bin/pgrep -x {$process}") != '');
+ $running = shell_exec("/bin/pgrep -x {$process}");
- return $running;
+ return !empty($running);
}
function isvalidproc($proc) {
diff --git a/etc/sshd b/etc/sshd
index a700615..1b54355 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -135,7 +135,15 @@
exit;
}
- if (!file_exists("$sshConfigDir/ssh_host_key")) {
+ // Check for all needed key files. If any are missing, the keys need to be regenerated.
+ $files_to_check = array('ssh_host_dsa_key','ssh_host_dsa_key.pub','ssh_host_key','ssh_host_key.pub','ssh_host_rsa_key','ssh_host_rsa_key.pub');
+ $generate_keys = false;
+ foreach ($files_to_check as $f2c) {
+ if (!file_exists("/etc/ssh/{$f2c}")) {
+ $generate_keys = true;
+ }
+ }
+ if ($generate_keys) {
/* remove previous keys and regen later */
file_notice("SSH", "{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.", "SSH KeyGen", "");
mwexec("rm /etc/ssh/ssh_host_*", true);
diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php
index 5a6c306..e6d4880 100644
--- a/usr/local/www/interfaces_ppps.php
+++ b/usr/local/www/interfaces_ppps.php
@@ -88,7 +88,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[5] = array("PPPs", true, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php
index d5b7cd5..48d727c 100755
--- a/usr/local/www/system_firmware_auto.php
+++ b/usr/local/www/system_firmware_auto.php
@@ -124,7 +124,12 @@ include("head.inc");
<?php
update_status(gettext("Downloading current version information") . "...");
-download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
+$nanosize = "";
+if ($g['platform'] == "nanobsd") {
+ $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
+}
+
+download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
$latest_version = str_replace("\n", "", @file_get_contents("/tmp/{$g['product_name']}_version"));
if(!$latest_version) {
update_output_window(gettext("Unable to check for updates."));
@@ -143,8 +148,13 @@ if(!$latest_version) {
if (pfs_version_compare($current_installed_buildtime, $current_installed_version, $latest_version) == -1) {
update_status(gettext("Downloading updates") . "...");
conf_mount_rw();
- $status = download_file_with_progress_bar("{$updater_url}/latest.tgz", "{$g['upload_path']}/latest.tgz", "read_body_firmware");
- $status = download_file_with_progress_bar("{$updater_url}/latest.tgz.sha256", "{$g['upload_path']}/latest.tgz.sha256");
+ if ($g['platform'] == "nanobsd") {
+ $update_filename = "latest{$nanosize}.img.gz";
+ } else {
+ $update_filename = "latest.tgz";
+ }
+ $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}", "{$g['upload_path']}/latest.tgz", "read_body_firmware");
+ $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}.sha256", "{$g['upload_path']}/latest.tgz.sha256");
conf_mount_ro();
update_output_window("{$g['product_name']} " . gettext("download complete."));
} else {
diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php
index 9eabe26..c676950 100755
--- a/usr/local/www/system_firmware_check.php
+++ b/usr/local/www/system_firmware_check.php
@@ -120,7 +120,13 @@ else
$updater_url = $g['update_url'];
$needs_system_upgrade = false;
$static_text .= gettext("Downloading new version information...");
-download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
+
+$nanosize = "";
+if ($g['platform'] == "nanobsd") {
+ $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
+}
+
+download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
$remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version"));
$static_text .= gettext("done") . "\\n";
if (!$remote_version) {
@@ -155,6 +161,9 @@ if ($needs_system_upgrade == false) {
echo "\n<script>$('invokeupgrade').style.visibility = 'visible';</script>";
$txt = gettext("A new version is now available") . "\\n\\n";
$txt .= gettext("Current version") .": ". $current_installed_version . "\\n";
+if ($g['platform'] == "nanobsd") {
+ $txt .= " " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n";
+}
$txt .= " " . gettext("Built On") .": ". $current_installed_buildtime . "\\n";
$txt .= " " . gettext("New version") .": ". $remote_version . "\\n\\n";
$txt .= " " . gettext("Update source") .": ". $updater_url . "\\n";
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php
index c3da004..058046a 100644
--- a/usr/local/www/system_usermanager.php
+++ b/usr/local/www/system_usermanager.php
@@ -174,7 +174,6 @@ if (isAllowedPage("system_usermanager")) {
}
if ($_POST) {
- conf_mount_rw();
unset($input_errors);
$pconfig = $_POST;
@@ -253,6 +252,7 @@ if (isAllowedPage("system_usermanager")) {
}
if (!$input_errors) {
+ conf_mount_rw();
$userent = array();
if (isset($id) && $a_user[$id])
$userent = $a_user[$id];
@@ -303,6 +303,16 @@ if (isAllowedPage("system_usermanager")) {
$userent['cert'][] = $cert;
}
$userent['uid'] = $config['system']['nextuid']++;
+ /* Add the user to All Users group. */
+ if (!is_array($config['system']['group']['member']))
+ $config['system']['group']['member'] = array();
+ foreach ($config['system']['group'] as $gidx => $group) {
+ if ($group['name'] == "all") {
+ $config['system']['group'][$gidx]['member'][] = $userent['uid'];
+ break;
+ }
+ }
+
$a_user[] = $userent;
}
OpenPOWER on IntegriCloud