* US and CA are in the alphabetic list already; no more favouritism.
* Use require_once consistently. Minor header tweaks.
* Replace legacy State/City info and fix spelling for "Saschsen".
Nice touch Jos, I had a big smile on my face while skimming that
commit. :)
* Prefer the openssh-portable port, but fall back to the base
version if it is available.
* Refactor the key generation to produce less duplicated code.
* Locking is completely bogus, but I have no clue how to fix
that short term without doing a full audit of the subsystem-dirty
mechanic.
* Add pkg autoremove for stale package removal.
* Refactor progress file output in case it'll change.
* Truncate the progress file directly on startup.
Unfortunately, that doesn't solve the lingering of upgrade
info after navigating away from the firmware page. Need to
find a better solution here...
PHP plugins may change and then clobber the custom php.ini we have
previously generated. To make sure everything keeps running smoothly,
always regerate it directly after an upgrade, even though there may
have been no changes.
At the moment the user can answer "yes" to most of the questions, but then later code only checks if the answer is "y". Thus you can type in "yes" in some places, have it accepted, but actually the negative action is taken. That is weird and will mess up people who try typing a whole string starting with "y".
With this change it makes the user type one of "y", "yes", "n", "no". When they type 1 of those, it is turned into either "y" or "n". Then the existing implementation logic all works as expected.
Hopefully this is the "final" version that fixes the behavior of the (y/n) questions.
I also included the bit at 296-297 which adds the CIDR bit-count range to the prompt, so the user can see exactly what input is valid/expected there.
Redmine issue #4100
Currently this allows the user to input any number for the CIDR. I happened to try 44 for an IPv4 CIDR when playing.
This fixes that little bug - I think it is good to commit that first/separately so it can be identified apart from the other (y/n) checking/handling I am working on. Better to have separate commits for distinct bugs.
Problem as per forum https://forum.pfsense.org/index.php?topic=83651.0
The problem comes whenever services_dhcpd_configure is called - the global $config gets reset from the actual current config, and any pending changes in the current process are lost.
It was introduced by commit 86ce2df
in which services_dhcpdv4_configure() does:
require_once('pkg-utils.inc')
and pkg-utils.inc does various stuff like:
if(file_exists("/cf/conf/use_xmlreader"))
require_once("xmlreader.inc");
else
require_once("xmlparse.inc");
which seems to cause a reset of the $config variable, thus losing the pending changes the user has entered at the console.
The top-level code in rc.initial.setlanip really does not need to (and should not) implement any changes along the way - it should collect all the answers from the user, then write_config and then make all the necessary calls to routines to implement the changes on the running system. This fixes it - defer any calls to services_dhcpd_configure() until after all questions are answered and write_config has happened.
While trying to see why this is not working for me (forum https://forum.pfsense.org/index.php?topic=83651.0 ) I have fixed some little things:
1) Get the new-lines right so the output of the restarting looks neat
2) Fix a comparison that had just a single equal sign - it did not break anything real because the subsequent code was just text output to the console. Now that text output does take notice of the correctly-evaluated condition, and $interface is not overwritten.
The issue in the forum post, about the interface IP address config not actually changing, is still the case, at least for me.
IMO these little tidy ups might as well be committed. They make this code better!
Reported by forum https://forum.pfsense.org/index.php?topic=86146.0
Also, if there are input validation errors, save the user-entered data and re-display it, making it easier for the user to just correct the data in error and press Test again. It was blanking out all the entered data.
This shouldn't break any current features and only works after installation of the jinja2 python package.
To test, execute
./execute_command.py template reload OPNsense.Sample