From: Cunningham, C. <ccu...@ma...> - 2003-03-26 14:27:55
|
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? |