Re: [squid-users] access-lists from mysql ?

From: Ali Jawad <alijawad1_at_gmail.com>
Date: Thu, 24 Jan 2013 17:05:16 +0200

Based on the docu I should setup something similar to

external_acl_type MyAclHelper %SRC %LOGIN %{Host}

    /usr/local/squid/libexec/myaclhelper

However I only want to authenticate based on src IP so I want to use :

external_acl_type MyAclHelper %SRC

    /usr/local/squid/libexec/myaclhelper

I am not getting any errors right now, but I am getting access denied,
although the script echoes OK, and it works using stdin

Regards

On Thu, Jan 24, 2013 at 3:44 PM, Ali Jawad <alijawad1_at_gmail.com> wrote:
> Thanks for that I did change the script to
>
> <?php
> $f = fopen( 'php://stdin', 'r' );
>
> while( $line = fgets( $f ) ) {
> echo "OK";
> }
>
>
> ?>
>
> while testing in command line using :
>
> /usr/bin/php myaclhelper.php
>
> Each time I press enter it returns OK, it keeps running and does not
> exit. However in squid log I get :
>
> The MyAclHelper helpers are crashing too rapidly, need help!
>
> What I think is wrong is that I need to identify what needs to handle
> the script, I.e. how does squid know this is a php script and not a
> perl script ?
>
> Regards
>
>
> On Thu, Jan 24, 2013 at 12:02 PM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
>> On 24/01/2013 10:44 p.m., Ali Jawad wrote:
>>>
>>> Hi
>>> Checking the db and echoing OK or ERR based on that is easy for me to
>>> implement in php, for now I did add the following :
>>>
>>> external_acl_type MyAclHelper %SRC /etc/squid/myaclhelper.php
>>>
>>> myaclhelper.php only contains
>>> <?php
>>> echo "OK";
>>> ?>
>>>
>>> Later on I want to replace that with a mysqldb check and read stdin to
>>> obtain %SRC, but for now I just want this to work, when squid starts I
>>> get the following in the log :
>>>
>>> The MyAclHelper helpers are crashing too rapidly, need help!
>>>
>>> Any help with this simple setup please ?
>>
>>
>>
>> You need a loop.
>>
>> Please read the intro section from the link below on how helpers operate
>> under Squid:
>> http://wiki.squid-cache.org/Features/AddonHelpers#How_do_the_helpers_communicate_with_Squid.3F
>>
>> (I have just updated it to clarify the I/O criteria helpers must follow and
>> what the consequences are).
>>
>> Amos
Received on Thu Jan 24 2013 - 15:05:44 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 24 2013 - 12:00:04 MST