From c197a542d5f0a9fd2ec2a7aa73aae11c24863dc3 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 13 Jun 2008 21:59:57 +0000 Subject: [PATCH] [HUDSON-1802] LDAP authentication with non-empty manager DN/password was not working correctly. In 1.225. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10095 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: 0f61ee2ca0187305f197dbddccee4c52d11fbc29 --- .../hudson/security/LDAPSecurityRealm/config.jelly | 6 +++--- .../WEB-INF/security/LDAPBindSecurityRealm.groovy | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly index ffde1f3..2757495 100644 --- a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly +++ b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly @@ -1,7 +1,7 @@ + checkUrl="'${rootURL}/securityRealms/LDAPSecurityRealm/serverCheck?field=server&server='+escape(this.value)+'&managerDN='+escape(this.form.elements['ldap.managerDN'].value)+'&managerPassword='+escape(this.form.elements['ldap.managerPassword'].value)"/> @@ -15,12 +15,12 @@ diff --git a/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy b/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy index 94c61c8..c56420f 100644 --- a/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy +++ b/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy @@ -16,10 +16,10 @@ import hudson.model.Hudson */ initialDirContextFactory(DefaultInitialDirContextFactory, instance.getLDAPURL() ) { - - // if anonymous bind is not allowed --- but what is the use of anonymous bind? - // managerDn = "..." - // managerPassword="..." + if(instance.managerDN!=null) { + managerDn = instance.managerDN; + managerPassword = instance.getManagerPassword(); + } } ldapUserSearch(FilterBasedLdapUserSearch, instance.userSearchBase, instance.userSearch, initialDirContextFactory) {