use sane way to get a default basedn: RootDSe's namingContexts
FossilOrigin-Name: 0912e353b480d0b8b290560ababc8c94c189952f6fd344eda5c24a0b35cb6c91
This commit is contained in:
parent
16ee62d1d9
commit
4fe75271e4
1 changed files with 3 additions and 6 deletions
9
shelldap
9
shelldap
|
|
@ -619,12 +619,9 @@ sub base
|
||||||
# try and determine base automatically from rootDSE
|
# try and determine base automatically from rootDSE
|
||||||
#
|
#
|
||||||
unless ( $self->{'base'} ) {
|
unless ( $self->{'base'} ) {
|
||||||
my $base = $self->{'root_dse'}->{'asn'} || {};
|
my @namingContexts = $self->{'root_dse'}->get_value('namingContexts');
|
||||||
$base = $base->{'attributes'} || [];
|
$conf->{'basedn'} = $namingContexts[0];
|
||||||
$base = $base->[0] || {};
|
$self->{'base'} = $namingContexts[0];
|
||||||
$base = $base->{'vals'} || [];
|
|
||||||
$conf->{'basedn'} = $base->[0];
|
|
||||||
$self->{'base'} = $base->[0];
|
|
||||||
}
|
}
|
||||||
if ( $_[0] ) {
|
if ( $_[0] ) {
|
||||||
$self->{'base'} = $_[0];
|
$self->{'base'} = $_[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue