new small code change to wbinfo_group.pl

From: <marco.puggelli-hp@dont-contact.us>
Date: Fri, 12 Jan 2007 18:49:52 +0100

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
Received on Fri Jan 12 2007 - 10:49:59 MST

This archive was generated by hypermail pre-2.1.9 : Thu Feb 01 2007 - 12:00:02 MST