I'm sorry if i harass someone, but i've checked the lastest wbinfo_group.pl
( from squid-2.6.STABLE6-20070112.tar.bz2 ) and I've noticed that using
split to populate the array, as expected, make it impossible to parse a
group name with space chars (common on Active Directory, think to "Domain
Admins").
The usage of shellwords fix this.


# Main loop
#
require 'shellwords.pl'; ### ADDED
while (<STDIN>) {
        chop;
   &debug ("Got $_ from squid");
        ($user, @groups) = &shellwords;  ### ADDED
   #    ($user, @groups) = split(/\s+/); ### REMOVED
   $user =~ 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";
   }
   &debug ("Sending $ans to squid");
   print "$ans\n";
}



best regards

Marco Puggelli
   Autostrade // per l'Italia S.p.A.
   Hewlett & Packard Consultant

Reply via email to