From: Chris R. <chr...@ma...> - 2003-03-26 14:56:55
|
On 26/3/03 2:27 pm, Cunningham, Chad <ccu...@ma...> wrote: > > Hi, > > I have a script using perl-ldap to keep an ldap database in sync with a > password file. It's worked fine for quite some time, however after a > recent server upgrade (and move from redhat 7.3 to redhat 8.0) it no > longer works. > > When I run it, I get an error that says Broken Pipe. No idea what that > means, but I'm starting from the beginning in trying to debug it. It is > trying to add a user to the ldap database that already exists, and that > obviously won't work. I've tracked it down to this piece of code and put > in some debugging output: > > if ($search eq "uid=khimgio") { print "same"; } > chop($search); > my $result = $ldap->search ( > #base => $base, > #scope => "sub", > #filter => "uid=khimgio", > #attrs => $attrs > base => $base, > scope => "sub", > filter => $search, > attrs => $attrs > ); > if ($result->entries) { print "got it"; } > > This is part of a much larger script. When I run it, the first user to be > processed is khimgio. The script outputs "same" indicating that we are > using a filter for uid=khimgio. Now here's the interesting part. If I run > this with the first set of arguments to the search (i.e. with a string > saying to filter on uid=khimgio), it prints out got it, indicating it > found the record. If I use the second set of arguments (the ones not > commented out) which are *exactly* the same only using $search instead of > manually setting the filter, it does not print out got it. > > As far as I can tell, $search is the same as "uid=khimgio". Why would one > fail and the other work? A similar sounding problem came up before. Then, Graham's comment: > Have you tried it with a pre 5.8 version of perl ? > > I have a feeling this is something todo with unicode/utf8 support > in 5.8 that Convert::ASN1 is not accounting for. > > As you are on RH 8.0, what do you have in /etc/sysconfig/i18n > > If it mentions UTF-8 try setting your LANG environment variable to en_US > > Graham. provided a solution. Cheers, Chris |