From 5fe3b65184ff67709c9b7b8b8712301664b2bb73 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 25 Jun 2010 10:46:19 -0400 Subject: Validate MTU in setup wizard. Ticket #464 --- usr/local/www/wizards/setup_wizard.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 64ffef1..485b2d2 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -328,6 +328,16 @@ submit + + + + \ No newline at end of file -- cgit v1.1 From 618e43ca4f4e6f36bcfd7c0ecc32c8d6cebfb5ad Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 25 Jun 2010 11:15:52 -0400 Subject: Do some more strict validation on hostname, domain, and DNS servers. Ticket #464 --- usr/local/www/wizards/setup_wizard.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 485b2d2..5d08501 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -59,6 +59,8 @@ input system->hostname EXAMPLE: myserver + ^[a-z0-9.|-]+$ + Invalid Hostname Domain @@ -75,12 +77,16 @@ yes 0 + ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ + Primary DNS Server field is invalid Secondary DNS Server input system->dnsserver 1 + ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ + Secondary DNS Server field is invalid Override DNS @@ -93,6 +99,26 @@ submit + + + 3 -- cgit v1.1 From ce6b39f25d512d41ea8b2d83f3a50ed5182438e0 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 25 Jun 2010 11:21:56 -0400 Subject: Hide GMZ offset zones in setup wizard. Ticket #464 --- usr/local/www/wizard.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index a59e83d..5ba3ff8 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -697,6 +697,8 @@ function showchange() { echo ""; echo "
- .
-- cgit v1.1 From 9e3aadbe90cb6708fa86471fef45be5965bea602 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 28 Jun 2010 15:56:53 -0400 Subject: Add checkboxes to disable TSO and LRO since some drivers will misbehave with them set. Resolves #703 --- etc/inc/pfsense-utils.inc | 21 ++++++++++++++++++ usr/local/www/system_advanced_network.php | 36 ++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index e3eef07..8d2e894 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -215,6 +215,27 @@ function enable_hardware_offloading($interface) { pfSense_interface_capabilities($interface, IFCAP_RXCSUM); } + if($config['system']['disablesegmentationoffloading']) { + if (isset($options['encaps']['tso4'])) + pfSense_interface_capabilities($interface, -IFCAP_TSO); + if (isset($options['encaps']['tso6'])) + pfSense_interface_capabilities($interface, -IFCAP_TSO); + } else { + if (isset($options['caps']['tso4'])) + pfSense_interface_capabilities($interface, IFCAP_TSO); + if (isset($options['caps']['tso6'])) + pfSense_interface_capabilities($interface, IFCAP_TSO); + } + + if($config['system']['disablelargereceiveoffloading']) { + if (isset($options['encaps']['lro'])) + pfSense_interface_capabilities($interface, -IFCAP_LRO); + } else { + if (isset($options['caps']['lro'])) + pfSense_interface_capabilities($interface, IFCAP_LRO); + } + + /* if the NIC supports polling *AND* it is enabled in the GUI */ $polling = isset($config['system']['polling']); if($polling && isset($options['caps']['polling'])) diff --git a/usr/local/www/system_advanced_network.php b/usr/local/www/system_advanced_network.php index d744a47..6c67e30 100644 --- a/usr/local/www/system_advanced_network.php +++ b/usr/local/www/system_advanced_network.php @@ -54,6 +54,8 @@ $pconfig['ipv6allow'] = isset($config['system']['ipv6allow']); $pconfig['polling_enable'] = isset($config['system']['polling']); $pconfig['sharednet'] = $config['system']['sharednet']; $pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']); +$pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']); +$pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']); $pconfig['flowtable'] = false; $pconfig['flowtable'] = isset($config['system']['flowtable']); @@ -111,12 +113,24 @@ if ($_POST) { if($_POST['disablechecksumoffloading'] == "yes") { $config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading']; - setup_microcode(); } else { unset($config['system']['disablechecksumoffloading']); - setup_microcode(); } + if($_POST['disablesegmentationoffloading'] == "yes") { + $config['system']['disablesegmentationoffloading'] = $_POST['disablesegmentationoffloading']; + } else { + unset($config['system']['disablesegmentationoffloading']); + } + + if($_POST['disablelargereceiveoffloading'] == "yes") { + $config['system']['disablelargereceiveoffloading'] = $_POST['disablelargereceiveoffloading']; + } else { + unset($config['system']['disablelargereceiveoffloading']); + } + + setup_microcode(); + // Write out configuration (config.xml) write_config(); @@ -234,7 +248,23 @@ function enable_change(enable_over) {
- + + + + + /> +
+ + + + + + + /> +
+ + + -- cgit v1.1 From 929a1b15cc627151655e126f88489930e828c7ef Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 10:36:48 -0400 Subject: Use the real interface list in setup_microcode() Fixes #705 --- etc/inc/pfsense-utils.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 8d2e894..3d12fa9 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -393,9 +393,9 @@ function setup_polling() { function setup_microcode() { /* if list */ - $ifdescrs = get_configured_interface_list(); + $ifs = get_interface_arr(); - foreach($ifdescrs as $if) + foreach($ifs as $if) enable_hardware_offloading($if); } -- cgit v1.1 From c3b13d6082033ecd1d3f7672ca9b1533942ec00a Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 11:26:31 -0400 Subject: Load cpufreq on nanobsd when enabling powerd. It's in the kernel on full installs. Fixes #704 --- etc/inc/system.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index ac8fa37..a79a5fb 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -34,13 +34,15 @@ pfSense_BUILDER_BINARIES: /bin/hostname /bin/ls /usr/bin/netstat /usr/sbin/syslogd pfSense_BUILDER_BINARIES: /usr/sbin/pccardd /usr/local/sbin/lighttpd /bin/chmod /bin/mkdir pfSense_BUILDER_BINARIES: /usr/bin/tar /bin/sync /usr/local/sbin/ntpd /usr/sbin/ntpdate - pfSense_BUILDER_BINARIES: /usr/bin/nohup /sbin/dmesg /usr/local/sbin/atareinit + pfSense_BUILDER_BINARIES: /usr/bin/nohup /sbin/dmesg /usr/local/sbin/atareinit /sbin/kldload pfSense_MODULE: utils */ function activate_powerd() { global $config, $g; if(isset($config['system']['powerd_enable'])) { + if ($g["platform"] == "nanobsd") + exec("/sbin/kldload cpufreq"); exec("/usr/sbin/powerd -b adp -a adp"); } else { if(is_process_running("powerd")) -- cgit v1.1 From b11bd589692d1958973b761b50929f2adb2eaad2 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 15:11:50 -0400 Subject: Forward back to system_advanced_admin.php and not system.php --- usr/local/www/system_advanced_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index bfa5061..31a658c 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -157,7 +157,7 @@ if ($_POST) { if ($port) $url = "{$prot}://{$host}:{$port}/system_advanced_admin.php"; else - $url = "{$prot}://{$host}/system.php"; + $url = "{$prot}://{$host}/system_advanced_admin.php"; } write_config(); -- cgit v1.1 From 09ba7f74c35c399c46f44cd95d509e5bb6703803 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 15:40:15 -0400 Subject: Fix this test, properly test if a variable is set. Fixes #691 --- usr/local/www/system_advanced_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index 31a658c..840d6bf 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -132,7 +132,7 @@ if ($_POST) { else unset($config['system']['enablesshd']); - $sshd_keyonly = $config['system']['sshdkeyonly']; + $sshd_keyonly = isset($config['system']['sshdkeyonly']); if ($_POST['sshdkeyonly']) $config['system']['sshdkeyonly'] = true; else -- cgit v1.1 From af31b277876c2da265c8ef40d6d4da1a7cfda810 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 16:06:16 -0400 Subject: Give users who have "all" privileges shell access. Part of ticket #614 --- etc/inc/auth.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 4f97f24..7dab743 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -253,7 +253,7 @@ function local_user_set(& $user) { mkdir($user_home, 0755); /* configure shell type */ - if (!userHasPrivilege($user, "user-shell-access")) { + if (!(userHasPrivilege($user, "user-shell-access") || userHasPrivilege($user, "page-all"))) { if (!userHasPrivilege($user, "user-copy-files")) $user_shell = "/sbin/nologin"; else -- cgit v1.1 From 0d5ff3835df7b59894283536a17b03ef29700727 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 16:26:18 -0400 Subject: Let pw handle the creation of the home directory rather than do it in php. --- etc/inc/auth.inc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 7dab743..2ce9f57 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -248,10 +248,6 @@ function local_user_set(& $user) { if (!is_dir($home_base)) mkdir($home_base, 0755); - // Ensure $user_home exists and is writable - if(!is_dir($user_home)) - mkdir($user_home, 0755); - /* configure shell type */ if (!(userHasPrivilege($user, "user-shell-access") || userHasPrivilege($user, "page-all"))) { if (!userHasPrivilege($user, "user-copy-files")) @@ -279,7 +275,7 @@ function local_user_set(& $user) { /* determine add or mod */ if (!strncmp($pwread, "pw:", 3)) { - $user_op = "useradd -o"; + $user_op = "useradd -m -o"; } else { $user_op = "usermod"; } -- cgit v1.1 From 77f7e3bf50f5aac001a9abe48d032fc4148b1994 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 16:29:57 -0400 Subject: Set a skeleton directory for pw --- etc/inc/auth.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 2ce9f57..ad434ab 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -275,7 +275,7 @@ function local_user_set(& $user) { /* determine add or mod */ if (!strncmp($pwread, "pw:", 3)) { - $user_op = "useradd -m -o"; + $user_op = "useradd -m -k /usr/share/skel -o"; } else { $user_op = "usermod"; } -- cgit v1.1 From cb58828465831cc4a4924462666d7a3c71293a3f Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 16:43:47 -0400 Subject: Add the standard .tcshrc to the skel files. --- usr/share/skel/dot.tcshrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 usr/share/skel/dot.tcshrc diff --git a/usr/share/skel/dot.tcshrc b/usr/share/skel/dot.tcshrc new file mode 100644 index 0000000..97ca003 --- /dev/null +++ b/usr/share/skel/dot.tcshrc @@ -0,0 +1,5 @@ +set prompt="%{\033[0;1;33m%}[%{\033[0;1;37m%}`cat /etc/version`%{\033[0;1;33m%}]%{\033[0;1;33m%}%B[%{\033[0;1;37m%}%n%{\033[0;1;31m%}@%{\033[0;1;37m%}%M%{\033[0;1;33m%}]%{\033[0;1;32m%}%b%/%{\033[0;1;33m%}(%{\033[0;1;37m%}%h%{\033[0;1;33m%})%{\033[0;1;36m%}%{\033[0;1;31m%}:%{\033[0;40;37m%} " +set autologout="0" +set autolist set color set colorcat +setenv CLICOLOR "true" +setenv LSCOLORS "exfxcxdxbxegedabagacad" -- cgit v1.1 From 29293dce60bdf28fa232b33625505436c5df33da Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 29 Jun 2010 16:51:25 -0400 Subject: Give users with ssh access a real shell, but make sure that admin still gets /etc/rc.initial --- etc/inc/auth.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index ad434ab..0af0594 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -254,6 +254,8 @@ function local_user_set(& $user) { $user_shell = "/sbin/nologin"; else $user_shell = "/usr/local/bin/scponly"; + } else { + $user_shell = "/bin/tcsh"; } /* root user special handling */ @@ -266,6 +268,7 @@ function local_user_set(& $user) { pclose($fd); $user_group = "wheel"; $user_home = "/root"; + $user_shell = "/etc/rc.initial"; } /* read from pw db */ -- cgit v1.1