• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

sledgehammer killall in shaper php and inc files

Plus 22.05 Development Snapshots (Retired)
2
5
1.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    luckman212 LAYER 8
    last edited by luckman212 Apr 7, 2022, 6:34 PM Apr 7, 2022, 6:34 PM

    (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 hits pfctl, then indiscriminately nuking pfctl could cause issues.

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Apr 8, 2022, 12:19 PM

      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.

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      L 1 Reply Last reply Apr 8, 2022, 12:51 PM Reply Quote 0
      • L
        luckman212 LAYER 8 @jimp
        last edited by Apr 8, 2022, 12:51 PM

        Thanks, should I submit a PR to remove it?

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Apr 8, 2022, 12:53 PM

          Sure, if you want to.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          L 1 Reply Last reply Apr 8, 2022, 11:42 PM Reply Quote 0
          • L
            luckman212 LAYER 8 @jimp
            last edited by Apr 8, 2022, 11:42 PM

            @jimp stuck in traffic so I did this from my phone. Should be ok though

            PR #4568

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.