]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1333: binfo_group.pl only looks into the first group specified
authorhno <>
Thu, 30 Jun 2005 02:38:59 +0000 (02:38 +0000)
committerhno <>
Thu, 30 Jun 2005 02:38:59 +0000 (02:38 +0000)
helpers/external_acl/wbinfo_group/wbinfo_group.pl

index d03a3335718f0037ff3ab791dd59c8ca9f70d76d..3c72c409b8b92b6d9cc1fe0fbe0abbca63e663a7 100644 (file)
@@ -17,6 +17,9 @@
 #   2002-07-05 Jerry Murdock <jmurdock@itraktech.com>
 #              Initial release
 #
+#   2005-06-28 Arno Streuli <astreuli@gmail.com>
+#               Add multi group check
+
 
 # Disable output buffering
 $|=1;           
@@ -46,9 +49,14 @@ sub check {
 while (<STDIN>) {
         chop;
        &debug ("Got $_ from squid");
-        ($user, $group) = split(/\s+/);
+        ($user, @groups) = split(/\s+/);
        $user =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("c",hex($1))/eg;
-       $group =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("c",hex($1))/eg;
+       # test for each group squid send in it's request
+       foreach $group (@groups) {
+               $group =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("c",hex($1))/eg;
+               $ans = &check($user, $group);
+               last if $ans eq "OK";
+       }
        $ans = &check($user, $group);
        &debug ("Sending $ans to squid");
        print "$ans\n";