changeset 12088:6cb0106507eb

8161743: Provide proper login context Reviewed-by: ahgross, vinnie, xuelei
author igerasim
date Tue, 30 Aug 2016 18:42:31 +0300
parents ec36155c8517
children e16018c90ebc
files src/share/classes/com/sun/security/auth/module/LdapLoginModule.java
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Tue Aug 30 02:38:21 2016 +0100
+++ b/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Tue Aug 30 18:42:31 2016 +0300
@@ -426,7 +426,6 @@
             constraints = new SearchControls();
             constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
             constraints.setReturningAttributes(new String[0]); //return no attrs
-            constraints.setReturningObjFlag(true); // to get the full DN
         }
 
         authzIdentity = (String)options.get(AUTHZ_IDENTITY);
@@ -886,11 +885,7 @@
             // (Use the first entry if more than one is returned)
             if (results.hasMore()) {
                 SearchResult entry = results.next();
-
-                // %%% - use the SearchResult.getNameInNamespace method
-                //        available in JDK 1.5 and later.
-                //        (can remove call to constraints.setReturningObjFlag)
-                userDN = ((Context)entry.getObject()).getNameInNamespace();
+                userDN = entry.getNameInNamespace();
 
                 if (debug) {
                     System.out.println("\t\t[LdapLoginModule] found entry: " +