changeset 8592:c258c9d0f7a7

8161743: Provide proper login context Reviewed-by: ahgross, vinnie, xuelei
author igerasim
date Tue, 30 Aug 2016 18:42:31 +0300
parents aa4bbea4a859
children 3a16befb1430
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	Mon Jan 30 05:20:58 2017 +0000
+++ b/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Tue Aug 30 18:42:31 2016 +0300
@@ -425,7 +425,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);
@@ -885,11 +884,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: " +