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

    sledgehammer killall in shaper php and inc files

    Scheduled Pinned Locked Moved Plus 22.05 Development Snapshots (Retired)
    5 Posts 2 Posters 1.3k Views
    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.
    • luckman212L
      luckman212 LAYER 8
      last edited by luckman212

      (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
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        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!

        luckman212L 1 Reply Last reply Reply Quote 0
        • luckman212L
          luckman212 LAYER 8 @jimp
          last edited by

          Thanks, should I submit a PR to remove it?

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            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!

            luckman212L 1 Reply Last reply Reply Quote 0
            • luckman212L
              luckman212 LAYER 8 @jimp
              last edited by

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

              PR #4568

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