Description of problem: wbinfo_group.pl provided by squid-2.5.STABLE3-2.3E enters a loop in perl with doubling mmaps. Loop is initiated by shellwords (/usr/lib/perl5/5.8.0/shellwords.pl) when using STDIN. For example: #!/usr/bin/perl -w require 'shellwords.pl'; ($user, $group) = &shellwords(<STDIN>); print "'$user' and '$group'\n"; is enough to cause the loop. Not sure if this is important, but a $line = <STDIN> and &shellwords($line) loops similarly, but specifying $line = "blah blah\n" and then doing the shellwords works fine (no loop). Version-Release number of selected component (if applicable): perl-5.8.0-88.1 How reproducible: Always Steps to Reproduce: 1. Use shellwords.pl with args from STDIN Actual Results: Loops, with memory size growing. Expected Results: Returned with a value. Additional info: May be for non-s390 platforms too, don't have one handy to try. wbinfo_group.pl is a standard winbindd group external acl for squid, which doesn't work because of this bug.
Created attachment 93754 [details] strace for wbinfo_group.pl ... killed after a few seconds of looping
I get the same issue, is there any update on this one. Thanks
Hallo all, with the new winbind Version 3.0.2a there ar another problem: winbind returns togehter with the groupSID the Domain Group number. So i changed two things in the script to become it working. Because i am not verry family with perl the systaxes are not pretty good but the script works for my solution. Hope that helps you to. Btw: In my opinion there is a problem with perl to read special characters from STDIN !? Regards Holger Schmieder #!/usr/bin/perl -w # external_acl helper to Squid to verify NT Domain group # membership using wbinfo # This program is put in the public domain by Jerry Murdock # <jmurdock>. It is distributed in the hope that it will # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Author: # Jerry Murdock <jmurdock> # # changed by Holger Schmieder <schmieder> 04/2004 # # Version history: # 2002-07-05 Jerry Murdock <jmurdock> # Initial release # # external_acl uses shell style lines in it's protocol require 'shellwords.pl'; # Disable output buffering $|=1; sub debug { # Uncomment this to enable debugging #print STDERR "@_\n"; } # # Check if a user belongs to a group # sub check { local($user, $group) = @_; $groupSID = `wbinfo -n "$group"` . " "; #because the new wbinfo -n returns also the group number #we do the following $groupSID = substr($groupSID,0,index($groupSID," ",0)); $groupGID = `wbinfo -Y $groupSID`; chop $groupGID; &debug( "User: -$user-\nGroup: -$group-\nSID: -$groupSID- \nGID: -$groupGID-"); return 'OK' if(`wbinfo -r \Q$user\E` =~ /^$groupGID$/m); return 'ERR'; } # # Main loop # while (<STDIN>) { chop; &debug ("Got $_ from squid"); #H1 was added by holger @H1=split(/\s+/, $_); #printf ("User:%s\n",$H1[0]); #printf ("Group:%s\n",$H1[1]); $user = $H1[0]; $group = $H1[1]; # ($user, $group) = &shellwords; $ans = &check($user, $group); &debug ("Sending $ans to squid"); print "$ans\n"; }
I have a similar problem with shellwords.pl on a Redhat ES3 server. The while() loop in shellwords.pl loops infinitely when a single line is passed in. This is with the Nagiostat package for Nagios. This same package worked great on an AIX box... but upon migrating to this Redhat ES3 server, because entirely unusable.
Very sorry for the long delay in processing this bug report. This is not a problem with the current release of perl in RHEL-3.