VPN: IPsec: Status Overview - hide phase 2 output based on phase 1 status instead of the row count for phase 2. closes https://github.com/opnsense/core/issues/9397
This likely has been in here for a very long time, but when filtering phase 2 entries, the grid can hide to never being shown again. To solve this without too much glue, look at the connected status of the phase 1 in order to show the children.
backend: move Safe to Shell class
Migrate the one user in the Monit migration to shell_safe() because
that is the most appropriate here (no error code needed, just output).
backend: move exec_safe, pass_safe and shell_safe to a class #9325
Do a clean cut to a class for these functions first. We need them in the
MVC code and this is a good opportunity to try and add them to the legacy
code via the wrappers.
The others should follow but let's settle on better names first perhaps.
backend: make mwexecf*() independent from mwexec[^f]* #9325
mexec(), mwexec_bg() and mwexecf_bg() are now deprecated and
should be removed. mwexecf_bg() is a bit of an oddity here but
since we now have mwexecfn() it is better used as mwexecfb()
and the error muting was also disabled on this one instead of
disabling it on mwexecf_bg().
This allows us to introduce this code in a batch update and
cherry-pick the callers afterwards.
backend: fiddle with mwexecf_bg for #9325
Never mute a background action, also because it is used nowhere and
I cannot recall an instance where we had to mute it either. Debug
output for backgrounding action failure is likely valuable information.
backend: also introduce pass_safe()
All these functions are bound to take a dynamic argument at some point.
Add a few callers although by no means complete for now.
system: mark these mwexec() as safe by switching to mwexecf() and a minor simplification #9325
We still have join() in there but arguments are properly fed from exec_safe().
We can clean this up later. Historically, these parts have had a few
regressions and problems so glossing over them is not the best idea.
backend: extend exec_safe() to allow array of format strings #9325
For years this has bothered me and the last couple of weeks I've tried
and failed to introduce something reasonable into $args handling that
can better do dynamic command generation paired with ease of use.
The irony is the solution was already in the code: $args supports arrays
and join(' ', $cmds) was used in caller code to construct the final
format string which is safe by default.
By making $format an array we can keep the separation of format and args
and are otherwise totally flexible in providing these to arrays and avoiding
any sort of ordering problems a number of other failed attempts at extending
this suffered from.