From: rettenbe Date: Thu, 10 Jan 2008 08:14:18 +0000 (+0000) Subject: bugfix: catch ldap error X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c8686d336f15c1f1bca1eaf9b4575110f52f761;p=gosa.git bugfix: catch ldap error git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8283 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index e3bee1793..a1432ad00 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -594,8 +594,12 @@ sub new_ldap_config { } # Build LDAP connection - my $ldap; - $ldap= Net::LDAP->new($ldap_uri); + my $ldap = Net::LDAP->new($ldap_uri); + if( not defined $ldap ) { + &main::daemon_log("ERROR: cannot connect to ldap: $ldap_uri", 1); + return; + } + # Bind to a directory with dn and password my $mesg= $ldap->bind($ldap_admin_dn, $ldap_admin_password);