Hi list,
a while ago i installed the smbldap-tools 0.8.5 on a 'SUSE LINUX
Enterprise Server 9 (x86_64)' system. Now the 'smbldap-tools' (using
the Net::LDAP lib) aren't working anymore but they worked perfectly
before. I can't tell you what was changed as the error ocurred the
first time.
I found the method where the errror occurs and attached the Net::Ldap
debug out and the relevant parts of the source.
It happens in:
$mesg->code && die $mesg->error;
The error message is:
decode error 16<=>30 at
/usr/lib/perl5/site_perl/5.8.3/Convert/ASN1/_decode.pm line 110, <DATA>
line 283.
Anyone had an similar error? Maybe it has something to do with the 64b
it system ? I have perl 5.8.3 installed.
thanx,
chris
----------------------------------
Debug out:
----------------------------------
Net::LDAP=HASH(0xbcc870) sending:
0000 103: SEQUENCE {
0002 1: INTEGER = 3
0005 98: [APPLICATION 3] {
0007 31: STRING = 'dc=geog,dc=uni-heidelberg,dc=de'
0028 1: ENUM = 2
002B 1: ENUM = 2
002E 1: INTEGER = 0
0031 1: INTEGER = 0
0034 1: BOOLEAN = FALSE
0037 46: [CONTEXT 0] {
0039 27: [CONTEXT 3] {
003B 11: STRING = 'objectclass'
0048 12: STRING = 'posixAccount'
0056 : }
0056 15: [CONTEXT 3] {
0058 3: STRING = 'uid'
005D 8: STRING = 'csengsto'
0067 : }
0067 : }
0067 0: SEQUENCE {
0069 : }
0069 : }
0069 : }
Net::LDAP=HASH(0xbcc870) received:
0000 3: [UNIVERSAL 22]
0002 : 01 00 04 __ __ __ __ __ __ __ __ __ __ __ __ __ ...
decode error 16<=>30 at
/usr/lib/perl5/site_perl/5.8.3/Convert/ASN1/_decode.pm line 110, <DATA>
line 283.
----------------------------------
A ldap search
----------------------------------
sub read_user
{
my $user = shift;
my $lines ='';
$ldap->debug(12);
my $mesg = $ldap->search ( # perform a search
base => $config{suffix},
scope => $config{scope},
filter => "(&(objectclass=posixAccount)(uid=$user))"
);
$mesg->code && die $mesg->error;
foreach my $entry ($mesg->all_entries) {
$lines.= "dn: " . $entry->dn."\n";
foreach my $attr ($entry->attributes) {
{
$lines.= $attr.": ".join(',',
$entry->get_value($attr))."\n";
}
}
}
chomp $lines;
if ($lines eq '') {
return undef;
}
return $lines;
}
----------------------------------
Connecting to ldap:
----------------------------------
sub connect_ldap_slave
{
# bind to a directory with dn and password
my $conf_cert;
my $ldap_slave = Net::LDAP->new(
"$config{slaveLDAP}",
port => "$config{slavePort}",
version => 3,
timeout => 60,
# debug => 0xffff,
)
or warn "erreur LDAP: Can't contact slave ldap server
($@)\n=>trying to contact the master server\n";
if (!$ldap_slave) {
print("connection to the slave failed: trying to contact the
master ...\n");
$ldap_slave = Net::LDAP->new(
"$config{masterLDAP}",
port => "$config{masterPort}",
version => 3,
timeout => 60,
# debug => 0xffff,
)
or die "erreur LDAP: Can't contact master ldap server ($@)\n";
}
if ($ldap_slave) {
if ($config{ldapTLS} == 1) {
$ldap_slave->start_tls(
verify => "$config{verify}",
clientcert => "$config{clientcert}",
clientkey => "$config{clientkey}",
cafile => "$config{cafile}"
);
}
$ldap_slave->bind ( "$config{masterDN}",
password => "$config{masterPw}"
);
$ldap=$ldap_slave;
return($ldap_slave);
}
}