ASF Bugzilla – Attachment 30671 Details for
Bug 55354
JNDIRealm.getPrincipal(context,username,gssCredential) corrupts realm context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to restore context params
JNDIRealm.java.patch (text/plain), 2.22 KB, created by
Richard Begg
on 2013-08-05 03:48:51 UTC
(
hide
)
Description:
Patch to restore context params
Filename:
MIME Type:
Creator:
Richard Begg
Created:
2013-08-05 03:48:51 UTC
Size:
2.22 KB
patch
obsolete
>*** java/org/apache/catalina/realm/JNDIRealm.java.orig 2013-08-05 13:39:37.564790607 +1000 >--- java/org/apache/catalina/realm/JNDIRealm.java 2013-08-05 13:42:46.088041007 +1000 >*************** >*** 2070,2078 **** >--- 2070,2081 ---- > > User user = null; > List<String> roles = null; >+ Hashtable preservedEnv = null; > > try { > if (gssCredential != null && isUseDelegatedCredential()) { >+ // Preserve current context params >+ preservedEnv = context.getEnvironment(); > // Set up context > context.addToEnvironment( > Context.SECURITY_AUTHENTICATION, "GSSAPI"); >*************** >*** 2088,2110 **** > roles = getRoles(context, user); > } > } finally { >! try { >! context.removeFromEnvironment( >! Context.SECURITY_AUTHENTICATION); >! } catch (NamingException e) { >! // Ignore >! } >! try { >! context.removeFromEnvironment( >! "javax.security.sasl.server.authentication"); >! } catch (NamingException e) { >! // Ignore >! } >! try { >! context.removeFromEnvironment( >! "javax.security.sasl.qop"); >! } catch (NamingException e) { >! // Ignore > } > } > >--- 2091,2109 ---- > roles = getRoles(context, user); > } > } finally { >! if (preservedEnv != null) { >! for (String param : Arrays.asList( >! Context.SECURITY_AUTHENTICATION, >! "javax.security.sasl.server.authentication", >! "javax.security.sasl.qop" )) { >! try { >! context.removeFromEnvironment(param); >! if (preservedEnv.containsKey(param)) >! context.addToEnvironment(param,preservedEnv.get(param)); >! } catch (NamingException e) { >! // Ignore >! } >! } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55354
: 30671