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/api/ClientConnection.java | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/opends/src/server/org/opends/server/api/ClientConnection.java b/opends/src/server/org/opends/server/api/ClientConnection.java
index 0d6e09f..d1ca3a3 100644
--- a/opends/src/server/org/opends/server/api/ClientConnection.java
+++ b/opends/src/server/org/opends/server/api/ClientConnection.java
@@ -618,7 +618,7 @@
{
if (authenticationInfo == null)
{
- authenticationInfo = new AuthenticationInfo();
+ setAuthenticationInfo(new AuthenticationInfo());
}
authenticationInfo.setMustChangePassword(mustChangePassword);
@@ -881,22 +881,22 @@
if ((authZEntry == null) ||
(! authZEntry.getDN().equals(authNEntry.getDN())))
{
- authenticationInfo =
- authenticationInfo.duplicate(newEntry, authZEntry);
+ setAuthenticationInfo(
+ authenticationInfo.duplicate(newEntry, authZEntry));
updatePrivileges(newEntry, authenticationInfo.isRoot());
}
else
{
- authenticationInfo =
- authenticationInfo.duplicate(newEntry, newEntry);
+ setAuthenticationInfo(
+ authenticationInfo.duplicate(newEntry, newEntry));
updatePrivileges(newEntry, authenticationInfo.isRoot());
}
}
else if ((authZEntry != null) &&
(authZEntry.getDN().equals(oldEntry.getDN())))
{
- authenticationInfo =
- authenticationInfo.duplicate(authNEntry, newEntry);
+ setAuthenticationInfo(
+ authenticationInfo.duplicate(authNEntry, newEntry));
}
}
@@ -910,7 +910,7 @@
*/
public void setUnauthenticated()
{
- this.authenticationInfo = new AuthenticationInfo();
+ setAuthenticationInfo(new AuthenticationInfo());
this.sizeLimit = DirectoryServer.getSizeLimit();
this.timeLimit = DirectoryServer.getTimeLimit();
}
--
Gitblit v1.10.0