From 00f5eee9ce02ed3e3d0b3c1f2658951b8f37acef Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 18 Mar 2007 00:41:40 +0000
Subject: [PATCH] Update the client connection code to ensure that any attempt to change the authentication info structure goes through the setAuthenticationInfo() method. This will ensure that all proper cleanup is done. Without doing this, there may be problems if a client connection is used to authenticate multiple times and the entry for one of the previous users is modified or deleted, since that could cause an attempt to update the client connection which is now authenticated as another user.
---
opends/src/server/org/opends/server/core/AuthenticatedUsers.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/AuthenticatedUsers.java b/opends/src/server/org/opends/server/core/AuthenticatedUsers.java
index cd47191..bf00081 100644
--- a/opends/src/server/org/opends/server/core/AuthenticatedUsers.java
+++ b/opends/src/server/org/opends/server/core/AuthenticatedUsers.java
@@ -59,9 +59,6 @@
public class AuthenticatedUsers
implements ChangeNotificationListener
{
-
-
-
// The mapping between authenticated user DNs and the associated client
// connection objects.
private ConcurrentHashMap<DN,CopyOnWriteArraySet<ClientConnection>>
@@ -130,6 +127,24 @@
/**
+ * Retrieves the set of client connections authenticated as the specified
+ * user. This method is only intended for internal testing use and should not
+ * be called for any other purpose.
+ *
+ * @param userDN The DN of the user for which to retrieve the corresponding
+ * set of client connections.
+ *
+ * @return The set of client connections authenticated as the specified user,
+ * or {@code null} if there are none.
+ */
+ synchronized CopyOnWriteArraySet<ClientConnection> get(DN userDN)
+ {
+ return userMap.get(userDN);
+ }
+
+
+
+ /**
* Performs any processing that may be required after an add
* operation.
*
--
Gitblit v1.10.0