summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-10-23 17:50:58 +0000
committerGordon Sim <gsim@apache.org>2008-10-23 17:50:58 +0000
commit8c8816163d5aea1ef46778d45b4f8e56bc9b9730 (patch)
tree08be33a7c65f27869532df1a7a9b18c3f4146426 /qpid/cpp/src
parent68b27bf4e8f87dba8388de48e39987dd2235d6c8 (diff)
downloadqpid-python-8c8816163d5aea1ef46778d45b4f8e56bc9b9730.tar.gz
don't append realm in null authenticator if the userid as supplied already ends with it
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@707427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
index 1f9bd9c576..c8c447e97b 100644
--- a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
+++ b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
@@ -141,7 +141,11 @@ void NullAuthenticator::start(const string& mechanism, const string& response)
string::size_type i = temp.find((char)0);
string uid = temp.substr(0, i);
string pwd = temp.substr(i + 1);
- connection.setUserId(str(format("%1%@%2%") % uid % realm));
+ i = uid.find_last_of(realm);
+ if (i == string::npos || i != (uid.size() - 1)) {
+ uid = str(format("%1%@%2%") % uid % realm);
+ }
+ connection.setUserId(uid);
}
} else {
connection.setUserId("anonymous");