Thread Probleme mit einem übernommenen Skript (7 answers)
Opened by k0kett at 2013-07-02 12:50

GwenDragon
 2013-07-02 13:02
#168703 #168703
User since
2005-01-17
14784 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
        my $result = $ad->search(base=>$path,filter=>"cn=*",attrs=>"cn");
        my $manager =  $result->entry(0)->get_value('managedBy');
        $result = $ad->search(base=>$manager,filter=>"cn=*",attrs=>"cn");

        #print decodeCertSubject($result->entry(0)->get_value('userCertificate')) . "\n";
        my ($oneline, $cn) = decodeCertSubject($result->entry(0)->get_value('userCertificate')); 

Dann benutze doch bitte mal die Funktion Dumper von Data::Dumper um dir ausgeben zu lassen, ob $manager und $result sinnvolle Daten liefert.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
use Data::Dumper;
        my $result = $ad->search(base=>$path,filter=>"cn=*",attrs=>"cn");
warn Dumper (\$result);
        my $manager =  $result->entry(0)->get_value('managedBy');
warn Dumper (\$manager);
        $result = $ad->search(base=>$manager,filter=>"cn=*",attrs=>"cn");

        #print decodeCertSubject($result->entry(0)->get_value('userCertificate')) . "\n";
        my ($oneline, $cn) = decodeCertSubject($result->entry(0)->get_value('userCertificate'));

Last edited: 2013-07-02 13:04:49 +0200 (CEST)

View full thread Probleme mit einem übernommenen Skript