0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

minor/safer

This commit is contained in:
dwight 2009-01-18 19:01:51 -05:00
parent 1ee8d1f93e
commit 500168288c
2 changed files with 4 additions and 2 deletions

View File

@ -28,11 +28,12 @@ namespace mongo {
};
class AuthenticationInfo : boost::noncopyable {
map<string, Auth> m;
map<string, Auth> m; // dbname -> auth
public:
AuthenticationInfo() { }
~AuthenticationInfo() {
}
void logout(const char *dbname) { m.erase(dbname); }
};
extern boost::thread_specific_ptr<AuthenticationInfo> authInfo;

View File

@ -84,7 +84,8 @@ namespace mongo {
double n = nonce.number();
{
double *ln = lastNonce.get();
double *ln = lastNonce.release();
if( ln == 0 || n != *ln ) {
log() << "auth: bad nonce received. could be a driver bug or a security attack. db:" << database->name << '\n'; log() << "field missing/wr " << database->name << '\n';
errmsg = "auth fails";