diff options
author | Simon Rettberg | 2015-10-29 15:57:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-10-29 15:57:03 +0100 |
commit | e58c616a6266ff4ec492c977af607fa317c8f781 (patch) | |
tree | a4aef44ace31dedab2ddf5bb397dbed8b19d5924 /src/main | |
parent | [CreateLdapConfig] Only regen local certs if CN changed; handle ca-bundle bas... (diff) | |
download | tmlite-bwlp-e58c616a6266ff4ec492c977af607fa317c8f781.tar.gz tmlite-bwlp-e58c616a6266ff4ec492c977af607fa317c8f781.tar.xz tmlite-bwlp-e58c616a6266ff4ec492c977af607fa317c8f781.zip |
[LdapSearch] Fix NPE
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/openslx/taskmanager/tasks/LdapSearch.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/LdapSearch.java b/src/main/java/org/openslx/taskmanager/tasks/LdapSearch.java index 3e641a5..a2b9f57 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/LdapSearch.java +++ b/src/main/java/org/openslx/taskmanager/tasks/LdapSearch.java @@ -3,15 +3,19 @@ package org.openslx.taskmanager.tasks; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Random; import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; import org.openslx.taskmanager.api.SystemCommandTask; import com.google.gson.annotations.Expose; public class LdapSearch extends SystemCommandTask { + + private static final Logger LOGGER = Logger.getLogger( LdapSearch.class ); @Expose private String server = null; @@ -65,6 +69,7 @@ public class LdapSearch extends SystemCommandTask } catch ( IOException e ) { FileUtils.deleteQuietly( pwFile ); status.messages = e.toString(); + LOGGER.warn( "Cannot create pwfile", e ); return null; } } @@ -86,13 +91,14 @@ public class LdapSearch extends SystemCommandTask // As we don't care about the certificate here, you might want to put TLS_REQCERT never // in /etc/ldap/ldap.conf - if ( this.binddn.isEmpty() ) { + if ( this.bindpw.isEmpty() ) { return new String[] { "ldapsearch", "-x", // Simple auth "-LLL", // No additional stuff "-H", this.server, // Host "-b", this.searchbase, // SB + "-D", this.binddn, // DN "-l", "4", // Time limit in seconds "-o", "nettimeout=4", "-z", "4", // Max number of results |