From 406f8bbabfa3b89480213d1744b940772b39673b Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 23 Oct 2008 17:50:58 +0000 Subject: 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/qpid@707427 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SaslAuthenticator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/SaslAuthenticator.cpp b/cpp/src/qpid/broker/SaslAuthenticator.cpp index 1f9bd9c576..c8c447e97b 100644 --- a/cpp/src/qpid/broker/SaslAuthenticator.cpp +++ b/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"); -- cgit v1.2.1