sledgehammer killall in shaper php and inc files
-
(This isn't specific to pfSense+ but posting here since that's the version I'm using)
I was looking into the limiters bug affecting 22.05 and while poking around, I stumbled onto this bad-looking code near the top of these three files:
/usr/local/www/firewall_shaper_vinterface.php
and/usr/local/www/firewall_shaper_queues.php
:if ($_GET['reset'] != "") { mwexec("/usr/bin/killall -9 pfctl"); exit; }
/usr/local/www/firewall_shaper.php
if ($_GET['reset'] != "") { /* XXX: Huh, why are we killing php? */ mwexec("/usr/bin/killall -9 pfctl php"); exit; }
This looks to be very old code—I can find it as far back as the oldest commit on github from 2015 (the XXX WTF is even in that one...).
I can't even find any references to when that
?reset
parameter would be passed, so it's probably not in use anymore. I was just thinking that if someone else was configuring something at the same time, or even a cronjob that hitspfctl
, then indiscriminately nukingpfctl
could cause issues. -
Those both look like dead code to me. I don't see anything on that page or even linking there that would set that parameter. Anything I see linking to those pages only uses actions like show, add, delete. No reset that I can find.
-
Thanks, should I submit a PR to remove it?
-
Sure, if you want to.
-