diff options
author | Gordon Sim <gsim@apache.org> | 2008-10-23 17:50:58 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-10-23 17:50:58 +0000 |
commit | 406f8bbabfa3b89480213d1744b940772b39673b (patch) | |
tree | c8defdecdfe849d0782f93aa15c82c2a59a03eee | |
parent | 9d6e5ee84b3c3a53dfe78d3b5b74986495e7abee (diff) | |
download | qpid-python-406f8bbabfa3b89480213d1744b940772b39673b.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/qpid@707427 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/broker/SaslAuthenticator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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"); |