OPNSense/core 6fdbcb0src/opnsense/mvc/app/library/OPNsense/Core Shell.php

backend: rearrange functions in Shell class
DeltaFile
+30-28src/opnsense/mvc/app/library/OPNsense/Core/Shell.php
+30-281 files

OPNSense/core 90a0178src/etc/inc util.inc, src/opnsense/mvc/app/library/OPNsense/Core Shell.php

backend: introduce Shell::run_safe and use it instead
DeltaFile
+31-68src/opnsense/mvc/app/library/OPNsense/Core/Shell.php
+1-16src/etc/inc/util.inc
+4-7src/opnsense/mvc/app/library/OPNsense/Trust/Store.php
+36-913 files

OPNSense/core 20f5b67src/opnsense/mvc/app/views/OPNsense/IPsec sessions.volt

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.
DeltaFile
+6-9src/opnsense/mvc/app/views/OPNsense/IPsec/sessions.volt
+6-91 files

OPNSense/core fa16cd7. plist, src/etc/inc util.inc

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).
DeltaFile
+0-71src/opnsense/mvc/app/library/OPNsense/Core/Safe.php
+40-0src/opnsense/mvc/app/library/OPNsense/Core/Shell.php
+4-6src/opnsense/mvc/app/models/OPNsense/Monit/Migrations/M1_0_0.php
+4-4src/etc/inc/util.inc
+0-1plist
+48-825 files

OPNSense/core 7d04c17. plist, src/etc/inc util.inc

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.
DeltaFile
+71-0src/opnsense/mvc/app/library/OPNsense/Core/Safe.php
+12-32src/etc/inc/util.inc
+1-0plist
+84-323 files

OPNSense/core f1fcc94src/etc/inc interfaces.inc system.inc, src/etc/inc/plugins.inc.d ipsec.inc dpinger.inc

backend: switch to mwexecfb() #9325
DeltaFile
+2-2src/etc/inc/plugins.inc.d/ipsec.inc
+1-1src/etc/inc/plugins.inc.d/dpinger.inc
+1-1src/etc/inc/interfaces.inc
+1-1src/etc/inc/plugins.inc.d/ntpd.inc
+1-1src/etc/inc/plugins.inc.d/unbound.inc
+1-1src/etc/inc/system.inc
+7-76 files

OPNSense/core 981f9a5src/etc/inc filter.inc

firewall: mwexecf() stuff #9325

mwexecfn() is actually really good to for grepping and therefore future
audits.  Two weird spots marked anyway.
DeltaFile
+8-8src/etc/inc/filter.inc
+8-81 files

OPNSense/core 17b4150src/etc/inc util.inc

system: mwexecf() for legacy service controls #9325
DeltaFile
+3-3src/etc/inc/util.inc
+3-31 files

OPNSense/core 175c159src/etc/inc system.inc util.inc, src/etc/inc/plugins.inc.d dhcpd.inc

backend: switch the previously touched join()s to implode()s
DeltaFile
+4-4src/etc/inc/system.inc
+2-2src/etc/inc/plugins.inc.d/dhcpd.inc
+1-1src/etc/inc/util.inc
+7-73 files

OPNSense/core 85908b5src/opnsense/scripts/firmware/repos OPNsense.php

firmware: replace joined command with new apporach #9325
DeltaFile
+8-5src/opnsense/scripts/firmware/repos/OPNsense.php
+8-51 files

OPNSense/core 593ecf2src/etc/inc util.inc

backend: comment
DeltaFile
+1-1src/etc/inc/util.inc
+1-11 files

OPNSense/core 4e6aecesrc/etc/inc util.inc

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.
DeltaFile
+39-9src/etc/inc/util.inc
+39-91 files

OPNSense/core 311dfb6src/etc/inc interfaces.inc util.inc, src/etc/inc/plugins.inc.d dpinger.inc ipsec.inc

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.
DeltaFile
+20-9src/etc/inc/plugins.inc.d/dpinger.inc
+6-4src/etc/inc/interfaces.inc
+3-6src/etc/inc/plugins.inc.d/ipsec.inc
+2-1src/etc/inc/util.inc
+31-204 files

OPNSense/core e21d2f5src/etc/inc interfaces.inc

interfaces: clear instances of mwexec() #9325
DeltaFile
+51-43src/etc/inc/interfaces.inc
+51-431 files

OPNSense/core 8a23547src/etc rc.routing_configure, src/etc/inc util.inc

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.
DeltaFile
+6-0src/etc/inc/util.inc
+2-2src/opnsense/scripts/shell/banner.php
+1-1src/opnsense/scripts/shell/ping.php
+1-1src/etc/rc.routing_configure
+10-44 files

OPNSense/core 39ec5d8src/etc/inc system.inc util.inc, src/etc/inc/plugins.inc.d ipsec.inc unbound.inc

backend: actually do a mwexecfm() #9325

Do not do a mwexefm_bg(). Reason in the next commit.
DeltaFile
+9-9src/etc/inc/system.inc
+7-2src/etc/inc/util.inc
+3-3src/etc/inc/plugins.inc.d/ipsec.inc
+2-2src/etc/inc/auth.inc
+1-2src/sbin/carp_service_status
+1-1src/etc/inc/plugins.inc.d/unbound.inc
+23-195 files not shown
+28-2411 files

OPNSense/core 6e4cd6fsrc/etc/inc interfaces.inc

interfaces: showpiece of what the new exec_safe() support does #9325
DeltaFile
+8-3src/etc/inc/interfaces.inc
+8-31 files

OPNSense/core ba284b5src/etc/inc/plugins.inc.d ipsec.inc

ipsec: mwexecf() switch audit thing #9325
DeltaFile
+6-6src/etc/inc/plugins.inc.d/ipsec.inc
+6-61 files

OPNSense/core 57d5976src/etc/inc system.inc

system: fix previous; a downside of mwexecf's parameter list ordering #9325

Maybe we should introduce a mwexecfm() for making this shorter.
DeltaFile
+4-4src/etc/inc/system.inc
+4-41 files

OPNSense/core b9da756src/etc/inc/plugins.inc.d dhcpd.inc

isc-dhcp: mwexecf() safety for #9325
DeltaFile
+6-5src/etc/inc/plugins.inc.d/dhcpd.inc
+6-51 files

OPNSense/core 42f9245src/etc/inc/plugins.inc.d radvd.inc

radvd: make a few security simplifications #9325
DeltaFile
+14-9src/etc/inc/plugins.inc.d/radvd.inc
+14-91 files

OPNSense/core 0c72e1fsrc/etc/inc/plugins.inc.d dnsmasq.inc openvpn.inc

plugins: minor mwexec(f) safety #9325
DeltaFile
+2-2src/etc/inc/plugins.inc.d/dnsmasq.inc
+1-1src/etc/inc/plugins.inc.d/openvpn.inc
+1-1src/etc/inc/plugins.inc.d/unbound.inc
+4-43 files

OPNSense/core b7e2c5fsrc/etc/inc system.inc

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.
DeltaFile
+12-13src/etc/inc/system.inc
+12-131 files

OPNSense/core e67ca60src/etc/inc/plugins.inc.d dhcrelay.inc

dhcrelay: use the new mwexecf() $format support #9325
DeltaFile
+12-6src/etc/inc/plugins.inc.d/dhcrelay.inc
+12-61 files

OPNSense/core e17268bsrc/etc/inc interfaces.inc

interfaces: transform this existing change using new exec_safe() magic #9325
DeltaFile
+10-6src/etc/inc/interfaces.inc
+10-61 files

OPNSense/core a661271src/etc/inc util.inc

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.
DeltaFile
+5-1src/etc/inc/util.inc
+5-11 files

OPNSense/core 67de8a6src/etc/inc/plugins.inc.d core.inc

system: try to enforce single quotes use for exec_safe() too
DeltaFile
+1-1src/etc/inc/plugins.inc.d/core.inc
+1-11 files

OPNSense/core cdfd8dcsrc/opnsense/scripts/auth add_user.php

system: legacy bindings already include phalcon load
DeltaFile
+1-1src/opnsense/scripts/auth/add_user.php
+1-11 files

OPNSense/core a837fd4src/etc/inc util.inc

backend: comment
DeltaFile
+1-1src/etc/inc/util.inc
+1-11 files

OPNSense/core fa49ec5src/etc/inc system.inc util.inc, src/etc/inc/plugins.inc.d dhcpd.inc

backend: switch the previously touched join()s to implode()s
DeltaFile
+4-4src/etc/inc/system.inc
+2-2src/etc/inc/plugins.inc.d/dhcpd.inc
+1-1src/etc/inc/util.inc
+7-73 files