From 45eee34489ddf0e78c1b813603229dfdc8e7197f Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Mon, 7 Dec 2009 15:29:44 +0800 Subject: [PATCH] 6886058: JNDI LDAP InitialLdapContext SECURITY_CREDENTIALS byte[] can be corrupted, then LDAP referral fails Reviewed-by: vinnie, xuelei --- jdk/src/share/classes/javax/naming/InitialContext.java | 4 +++- .../classes/javax/naming/directory/InitialDirContext.java | 4 +++- .../share/classes/javax/naming/ldap/InitialLdapContext.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java index 0e105d0f840..b9cc6e545dc 100644 --- a/jdk/src/share/classes/javax/naming/InitialContext.java +++ b/jdk/src/share/classes/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,6 +198,8 @@ public class InitialContext implements Context { * *

This constructor will not modify environment * or save a reference to it, but may save a clone. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * * @param environment * environment used to create the initial context. diff --git a/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java b/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java index d96643acf4b..1a3aac6407e 100644 --- a/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,8 @@ public class InitialDirContext extends InitialContext implements DirContext { * *

This constructor will not modify environment * or save a reference to it, but may save a clone. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * * @param environment * environment used to create the initial DirContext. diff --git a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java index 896cae8ccaf..757d29e7f78 100644 --- a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,6 +110,8 @@ public class InitialLdapContext extends InitialDirContext implements LdapContext * *

This constructor will not modify its parameters or * save references to them, but may save a clone or copy. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * *

connCtls is used as the underlying context instance's * connection request controls. See the class description