diff options
Diffstat (limited to 'cpp/src/qpid/broker/SaslAuthenticator.cpp')
-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"); |