Skip to content

Commit

Permalink
[FIXED JENKINS-8152]
Browse files Browse the repository at this point in the history
Formatting error in the rootDN inference code. It shouldn't include
attribute name.
  • Loading branch information
kohsuke committed Jan 28, 2012
1 parent d765997 commit c99fc31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -65,6 +65,9 @@
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12529">issue 12529</a>)
<li class=ref>
Matrix job now allows delete whole matrix, including sub-jobs.
<li class=bug>
Fixed a bug in LDAP default root DN inference.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-8152">issue 8152</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/security/LDAPSecurityRealm.java
Expand Up @@ -325,8 +325,8 @@ private String inferRootDN(String server) {
DirContext ctx = new InitialDirContext(props);
Attributes atts = ctx.getAttributes("");
Attribute a = atts.get("defaultNamingContext");
if(a!=null) // this entry is available on Active Directory. See http://msdn2.microsoft.com/en-us/library/ms684291(VS.85).aspx
return a.toString();
if(a!=null && a.get()!=null) // this entry is available on Active Directory. See http://msdn2.microsoft.com/en-us/library/ms684291(VS.85).aspx
return a.get().toString();

a = atts.get("namingcontexts");
if(a==null) {
Expand Down

0 comments on commit c99fc31

Please sign in to comment.