Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Morsche erstemal :)

Ich hab ein Perl-Script zum Auslesen einer LDAP-Struktur beliebiger Tiefe geschrieben.

Nun geht der bei mir aber nur den ersten Ast des baumes ab und hört dann auf. Der Baum hat aber 8 Äste, die eigentlich abgeklappert werden müssten.

Hier das Script:


#!/usr/bin/perl


use Net::LDAP;


$ldap = Net::LDAP->new( "xxx.xxx.xxx.xxx" );


$mesg = $ldap->bind;


search_and_fill();


sub search_and_fill {

my $neu = shift;


if( $neu eq 'undef' || $neu eq '')

{

$mesg = $ldap->search(

                        base => 'o=firma',

                        scope => 'one',

                        filter => "objectclass=organizationalUnit" && "objectclass=top",

                        attrs => ['1.1']);

}

else

{

$mesg = $ldap->search(

                        base => $neu,

                        scope => 'one',

                        filter => "objectclass=organizationalUnit" && "objectclass=top",

                        attrs => ['1.1']);

}

@entries = $mesg->entries;

foreach $entr ( @entries )

{

$dn = $entr->dn;

        if($dn =~ m/\bou=\b/i)

        {

        print "$dn\n";

                if( $dn eq 'undef' || $dn eq '')

                {

                return;

                }

                else

                {

                push( @baum, $dn);

                return search_and_fill($dn);

                }

        }                                       

}


};

$ldap->unbind();

Und hier das Ergebnis des Servers:

OU=erste OU,O=Firma

OU=erste UnterOU,OU=erste OU,O=Firma

Das ist also nur der erste Ast, genaue Bezeichnungen habe ich aus Datenschutzgründen rausgenommen.

Wäre froh, wenn mir da jemand weiterhelfen könnte, da ich keine Ahnung habe wo der Fehler liegt :)

hab das mal probiert, aber dann gibt er gar nix mehr zurück. egal welches scope man auf sub setzt.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.