diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 3a72db9c75..4f97f24ee8 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -269,9 +269,9 @@ function local_user_set(& $user) {
fwrite($fd, $user['password']);
pclose($fd);
$user_group = "wheel";
+ $user_home = "/root";
}
-
/* read from pw db */
$fd = popen("/usr/sbin/pw usershow {$user_name} 2>&1", "r");
$pwread = fgets($fd);
@@ -295,18 +295,6 @@ function local_user_set(& $user) {
fwrite($fd, $user['password']);
pclose($fd);
-
- /* admin user special handling */
- if ($user_uid == 0) {
- $cmd = "/usr/sbin/pw usermod -q -n {$user_name} -s /etc/rc.initial -H 0";
- if($debug)
- log_error("Running: {$cmd}");
- $fd = popen($cmd, "w");
- fwrite($fd, $user['password']);
- pclose($fd);
- $user_group = "wheel";
- }
-
/* create user directory if required */
if (!is_dir($user_home)) {
mkdir($user_home, 0700);
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index c3a8cd2422..fe7c047905 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1011,9 +1011,12 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "
$tgt = "($if)";
}
/* Add the protocol, if defined */
- if (!empty($proto) && $proto != "any")
- $protocol = " proto {$proto}";
- else
+ if (!empty($proto) && $proto != "any") {
+ if ($proto == "tcp/udp")
+ $protocol = " proto { tcp udp }";
+ else
+ $protocol = " proto {$proto}";
+ } else
$protocol = "";
/* Add the hard set source port (useful for ISAKMP) */
if($natport != "")
@@ -1423,7 +1426,7 @@ EOD;
$natrules .= "rdr-anchor \"miniupnpd\"\n";
if(!empty($reflection_txt))
- $natrules .= "\n" . $reflection_txt;
+ $natrules .= "\n# Reflection redirects and NAT for 1:1 mappings\n" . $reflection_txt;
return $natrules;
}
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index 6d6c43ddf8..72e14b2629 100755
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -118,7 +118,7 @@ include("head.inc");
?>
-
=$a_gateway[$gateway['name']]['descr']; ?> |
+ =$a_gateways[$gateway['name']]['descr']; ?> |
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 700ba41a80..98d1e818c6 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -375,7 +375,7 @@ function show_advanced_gateway() {
?>
=gettext("Alternative monitor IP"); ?>
- .
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php
index 058046a3a2..f89d8345fc 100644
--- a/usr/local/www/system_usermanager.php
+++ b/usr/local/www/system_usermanager.php
@@ -207,15 +207,30 @@ if (isAllowedPage("system_usermanager")) {
if (($_POST['passwordfld1']) && ($_POST['passwordfld1'] != $_POST['passwordfld2']))
$input_errors[] = gettext("The passwords do not match.");
+ if (isset($id) && $a_user[$id])
+ $oldusername = $a_user[$id]['name'];
+ else
+ $oldusername = "";
/* make sure this user name is unique */
- if (!$input_errors && !(isset($id) && $a_user[$id])) {
+ if (!$input_errors) {
foreach ($a_user as $userent) {
- if ($userent['name'] == $_POST['usernamefld']) {
+ if ($userent['name'] == $_POST['usernamefld'] && $oldusername != $_POST['usernamefld']) {
$input_errors[] = gettext("Another entry with the same username already exists.");
break;
}
}
}
+ /* also make sure it is not reserved */
+ if (!$input_errors) {
+ $system_users = explode("\n", file_get_contents("/etc/passwd"));
+ foreach ($system_users as $s_user) {
+ $ent = explode(":", $s_user);
+ if ($ent[0] == $_POST['usernamefld'] && $oldusername != $_POST['usernamefld']) {
+ $input_errors[] = gettext("That username is reserved by the system.");
+ break;
+ }
+ }
+ }
/*
* Check for a valid expirationdate if one is set at all (valid means,
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index a59e83dd82..5ba3ff8ee1 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -697,6 +697,8 @@ function showchange() {
echo "";
echo " |