From 4de760aa81793ab593297cc1686a6a8f15d4e4d3 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 17 Aug 2009 18:36:47 +0000 Subject: [PATCH] Failed to look up an e-mail address for LDAP users shouldn't cause a build to fail. (report) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20792 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: f7ce9c551b1d6d0717a45afed705b979fd3c72a1 --- core/src/main/java/hudson/security/LDAPSecurityRealm.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/hudson/security/LDAPSecurityRealm.java b/core/src/main/java/hudson/security/LDAPSecurityRealm.java index beee7f3..69d4bf8 100644 --- a/core/src/main/java/hudson/security/LDAPSecurityRealm.java +++ b/core/src/main/java/hudson/security/LDAPSecurityRealm.java @@ -36,6 +36,7 @@ import hudson.util.Scrambler; import hudson.util.spring.BeanBuilder; import org.acegisecurity.AuthenticationManager; import org.acegisecurity.GrantedAuthority; +import org.acegisecurity.AcegiSecurityException; import org.acegisecurity.ldap.InitialDirContextFactory; import org.acegisecurity.ldap.LdapDataAccessException; import org.acegisecurity.ldap.LdapTemplate; @@ -57,6 +58,7 @@ import org.springframework.web.context.WebApplicationContext; import javax.naming.Context; import javax.naming.NamingException; +import javax.naming.AuthenticationException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.DirContext; @@ -433,6 +435,9 @@ public class LDAPSecurityRealm extends SecurityRealm { } catch (NamingException e) { LOGGER.log(Level.FINE, "Failed to look up LDAP for e-mail address",e); return null; + } catch (AcegiSecurityException e) { + LOGGER.log(Level.FINE, "Failed to look up LDAP for e-mail address",e); + return null; } } }