From 4fe75271e471913bf7d57ac61fdf044ea07369a2 Mon Sep 17 00:00:00 2001 From: "peter@adpm.de" Date: Sat, 5 Mar 2011 18:08:49 +0000 Subject: [PATCH] use sane way to get a default basedn: RootDSe's namingContexts FossilOrigin-Name: 0912e353b480d0b8b290560ababc8c94c189952f6fd344eda5c24a0b35cb6c91 --- shelldap | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shelldap b/shelldap index f061a73..86ea6b6 100755 --- a/shelldap +++ b/shelldap @@ -619,12 +619,9 @@ sub base # try and determine base automatically from rootDSE # unless ( $self->{'base'} ) { - my $base = $self->{'root_dse'}->{'asn'} || {}; - $base = $base->{'attributes'} || []; - $base = $base->[0] || {}; - $base = $base->{'vals'} || []; - $conf->{'basedn'} = $base->[0]; - $self->{'base'} = $base->[0]; + my @namingContexts = $self->{'root_dse'}->get_value('namingContexts'); + $conf->{'basedn'} = $namingContexts[0]; + $self->{'base'} = $namingContexts[0]; } if ( $_[0] ) { $self->{'base'} = $_[0];