Skip to content

fon: fix CVE-ABSP #185 #186

Merged
merged 1 commit into from
May 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions fon/fon.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
my %multichar;
my %escapechar;

my $cache = 'ldap.dump';
my $USECACHE = 0;

my %L;
Expand Down Expand Up @@ -105,27 +104,19 @@ sub exec_ldapsearch {
sub get_ldap_addressbook {
my $L = shift;
my @LDAP;
if ( $USECACHE and -s $cache ) {
open C, '<', $cache or die "$!";
push @LDAP, (<C>);
close C;
}
else {
open C, '>', $cache or die "$!";

my $pid = open P, '-|';
defined $pid or die "$!\n";
$pid or exec_ldapsearch( '-b', 'dc=addressbook,dc=apps,dc=molgen,dc=mpg,dc=de' );
binmode P, ':utf8';
my $pid = open P, '-|';
defined $pid or die "$!\n";
$pid or exec_ldapsearch( '-b', 'dc=addressbook,dc=apps,dc=molgen,dc=mpg,dc=de' );
binmode P, ':utf8';

while (<P>) {
print C $_;
push @LDAP, $_;
}
close P;
close C;
$? and die "get_ldap_addressbook() failed\n";
while (<P>) {
push @LDAP, $_;
}
close P;

$? and die "get_ldap_addressbook() failed\n";

my ($uid) = ('');

my @addlist = ( 'sn', 'givenName', 'mail', 'roomNumber', 'collectionId', 'telephoneNumber' );
Expand Down