Until 2.3.x pfSense carried a patch that changed the behavior of 'route
change' command, making it add the route when it fails to change.
On 2.4 this patch was removed and will not be added back. This change
adjust PHP code to deal with route add / change and make it work
without the patch
This function used to replace /boot.conf, /boot/loader.conf and
/etc/ttys on every call. Depending of the moment a power failure
happens, any of these files can be blank and it'll break console setup
on next boot.
Usa safe_write_file() to save these 3 files to disk to make sure they
are sync'd
We do not create /etc/ttys from scratch but we change it on every boot.
If original file is corrupted for some reason we can end up with a file
missing essential lines. Added a check to verify if these lines are
missing and add them back in this case
Verify if addresses are valid IP address before convert them to make
numeric comparison.
While here, adjust indent.
Inspired by: @phil-davis patch at PR #3189
On dc61252ae the code used to restore dhcp6 leases when platform was
nanobsd was removed, but this code is supposed to run on full install
when it's configured to use MFS /tmp. Restored it, adjusting indent,
and add the correct conditional to run on MFS /tmp
Spotted-by: @phil-davis
If the user has input invalid values into range from and to, then there
is no point checking any IPv6 VIPs to see if they fall in the range.
None of them would be "in range" because the specified range is not even
valid.
This allows the caller to do a single "atomic" call to unlink_if_exists.
If it returns true, then they know that the file existed and that it has
been unlinked successfully.
This should help avoid race conditions where multiple code paths try
sequences like:
if (file_exists("somefile") {
unlink("somefile");
do_other_stuff();
}
in the case where we really only want do_other_stuff() to happen for the
code path that is the first one to actually unlink the file.
Break verbose option in two for showing files and/or constructed command. (--show_files, --show_command)
Don't save new commit ID if dry run. (--dry-run)
(cherry picked from commit a6fd4c0ff4)
1) Unlink earlier to reduce the chances of any concurrency issues;
2) Translate and improve output of available notification;
3) While I'm here, fix whitespace and improve PHP syntax.