Re: [linux] SQUID-LDAP problem

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: tidalbobo
Date:  
To: Yajith Ajantha Dayarathna | යජිත් අජන්ත දයාරත්න, linux
Subject: Re: [linux] SQUID-LDAP problem
Problem fixed. Thank you for all the help.

i wrote an external helper using perl. If any one needs it, feel free to
use.
Its pretty crude, but functional.


--------------------------------------
external_acl_type *ldap_ip* %LOGIN %SRC /usr/lib/squid/squid_ldap_ip
 acl iplocked external *ldap_ip*



this is the squid_ldap_ip
---------------------------------------
#!/usr/bin/perl
# author : tidalbobo@???
# use : validate ip from ldap for squid
# GNU GPL
# 2009/09/24
$|=1;


$ldap_server_ip = "__________________";
$ldap_search_base = "______________________"
while(<>) {
chomp;
@vals = split(/ /,$_);
$name=$vals[0];
$ip=$vals[1];

$cmd="ldapsearch -h $ldap_server_ip -x -b O=$ldap_search_base -LLL
\"(&(uid=$name)(c=$ip))\" $name";
$returncode = `$cmd`;

if (!$returncode) {
print "ERR\n";
} else {
print "OK\n";
}
}


---------------------------------------
_______________________________________________
linux mailing list
linux@???
https://secure.lug.lk/mailman/listinfo/linux