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

    Minor error

    Scheduled Pinned Locked Moved Captive Portal
    2 Posts 2 Posters 727 Views 2 Watching
    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.
    • GertjanG Offline
      Gertjan
      last edited by

      In here :
      /etc/captiveportal.inc - function captiveportal_init_general_rules()

      At the end :

      	/* load rules */
      	file_put_contents("{$g['tmp_path']}/ipfw.cp.rules", $cprules);
      	mwexec("/sbin/ipfw -q {$g['tmp_path']}/ipfw.cp.rules", true);
      	@unlink("{$g['tmp_path']}/ipfw_{$cpzone}.cp.rules");
      	unset($cprules);
      }
      

      file_put_contents : the file /tmp/ipfw.cp.rules is created.
      This file /tmp/ipfw.cp.rules is passed to "ipfw" as a command line parameter.
      Another file is deleted (unlined) : /tmp//ipfw**_{$cpzone}**.cp.rules

      Why another file ?

      	@unlink("{$g['tmp_path']}/ipfw_{$cpzone}.cp.rules");
      

      should be :

      	@unlink("{$g['tmp_path']}/ipfw.cp.rules");
      

      Right ?

      I guess the file /tmp/ipfw.cp.rules will get overwritten anyway the next time the "general" ipfw rules are re created, so this is a non issue.

      It's a redmine case ?

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

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

        Looks wrong to me but code in that area is already being overhauled significantly and is going to be irrelevant soon, so it may be moot.

        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!

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