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

    Why add new empty line to captiveportal.inc …...

    Scheduled Pinned Locked Moved Captive Portal
    8 Posts 4 Posters 2.4k 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.
    • N
      new_in_pf
      last edited by

      Hi guys

      I use captiveportal and freeradius on mysql database for accounting.
      My problem is that add blank lines in line 525 of /etc/inc/captiveportal.inc file so that after a week exist thousands empty line between line 525 and 526.
      when this happen, the captiveportal update packets that contain the user connection information don't recieve and in this case  traffic of users limitation not compute and idle-timeout , … not apply.

      if i delete these lines, save the file and restart captiveportal service all things back to normal case.

      Can i find how to add these lines and by what file or program these lines add to captiveportal.inc file?

      Thanks for your help, my friends.

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        @new_in_pf:

        …..
        Can i find how to add these lines and by what file or program these lines add to captiveportal.inc file?

        Line 525 :  https://github.com/pfsense/pfsense/blob/master/etc/inc/captiveportal.inc#L525

        pfSense doesn't auto-modify this file.

        You setup is plain broke / not original / has strange rogue packages / has been hacked.

        Reinstall - and use only basic settings, no hacks, no non-stable packages.

        You could even declare /etc/inc/captiveportal.inc as read only, but remember to undo this when doing auto updates.

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

          The squid 3.x package alters that file, which it really should not be doing.

          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
          • N
            new_in_pf
            last edited by

            I am using pfsense 2.1, squid3-dev with transparent mode and captiveportal

            when i enable  transparent mode of squid, these empty lines added to file, even i get any permission of capticeportal.inc file but this will continue to add empty lines.

            I attach the normal captiveportal file and with squid captiveportal.inc.

            In the file captiveportal-squid.inc add empty lines after line 525.

            thanks for your time.

            captiveportal-squid.txt
            captiveportal.txt

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              Yeah, stop using the Squid patch.@new_in_pf:

              when i enable  transparent mode of squid, these empty lines added to file, even i get any permission of capticeportal.inc file but this will continue to add empty lines.

              Yeah, stop enabling that with CP.

              https://redmine.pfsense.org/issues/4583

              1 Reply Last reply Reply Quote 0
              • N
                new_in_pf
                last edited by

                for prevention of stop sending update packets by captiveportal find a page in pfsense forum :

                https://forum.pfsense.org/index.php?topic=83279.msg456463#msg456463

                I add this cron to run /etc/rc.prunecaptiveportal zone_name  every minute

                */1 * * * * root /etc/rc.prunecaptiveportal zone_name

                and now it work correctly.

                Is there any problem for use from this?

                1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan
                  last edited by

                  @new_in_pf:

                  for prevention of stop sending update packets by captiveportal find a page in pfsense forum :
                  https://forum.pfsense.org/index.php?topic=83279.msg456463#msg456463

                  This was a problem with an ancient version of pfSEnse.
                  Upgrade to a recent version and problem is solved.
                  Do NOT keep old pfSense versions. Think about the huge security issues …

                  @new_in_pf:

                  I add this cron to run /etc/rc.prunecaptiveportal zone_name  every minute
                  */1 * * * * root /etc/rc.prunecaptiveportal zone_name
                  and now it work correctly.

                  When you activate a portal zone, for every zone, a cron is already run every 1 minute.
                  Why doubling it ?

                  Enter SSH, and type
                  ps ax | grep 'cron'
                  and you will see it.

                  NOTE: old pfSense version had the problem that these cron's would die … Just update, and problem is solved.

                  @new_in_pf:

                  Is there any problem for use from this?

                  Yes, The one launched by the pfSEnse will also run, and your instance will lockout the pfSense 'cron' (or the other way around). Parsing all clients can take seconds, or even more.
                  The final result will be: no one gets disconnected.

                  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
                  • D
                    doktornotor Banned
                    last edited by

                    @doktornotor:

                    Yeah, stop using the Squid patch.@new_in_pf:

                    when i enable  transparent mode of squid, these empty lines added to file, even i get any permission of capticeportal.inc file but this will continue to add empty lines.

                    Yeah, stop enabling that with CP.

                    https://redmine.pfsense.org/issues/4583

                    Now with PR to remove the "feature" and hopefully fix the screwed code. https://github.com/pfsense/pfsense-packages/pull/904

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