Squid captive portal integration fix


  • The squid3-devl package has an option to enable captive portal authentication, the script which glues this together seems to be a bit unfinished, here is what I did to get it working:

    open file /usr/pbi/squid-amd64/libexec/squid/check_ip.php
    starting on line 52 replace and insert following fixed lines:

    $result = sqlite_array_query($dbhandle, $query, SQLITE_ASSOC);
    if ($result){
      foreach ($result as $rownum => $row)
      {
    $cp_db[$rownum]=implode(",",$row);
        }
            sqlite_close($dbhandle);
    }

    There is one other bug which spams the squid access log with helperHandleRead: unexpected read from check_ip_portal #1, 4 bytes 'ERR
    that needs to be repaired. I believe we just need to check if STDIN is white space character and if so ignore. This doesn't affect functionality though.


  • Thanks for the contribution. I've merged it on squid3-dev pkg v 2.2.1