mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
minor/safer
This commit is contained in:
parent
1ee8d1f93e
commit
500168288c
@ -28,11 +28,12 @@ namespace mongo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class AuthenticationInfo : boost::noncopyable {
|
class AuthenticationInfo : boost::noncopyable {
|
||||||
map<string, Auth> m;
|
map<string, Auth> m; // dbname -> auth
|
||||||
public:
|
public:
|
||||||
AuthenticationInfo() { }
|
AuthenticationInfo() { }
|
||||||
~AuthenticationInfo() {
|
~AuthenticationInfo() {
|
||||||
}
|
}
|
||||||
|
void logout(const char *dbname) { m.erase(dbname); }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern boost::thread_specific_ptr<AuthenticationInfo> authInfo;
|
extern boost::thread_specific_ptr<AuthenticationInfo> authInfo;
|
||||||
|
@ -84,7 +84,8 @@ namespace mongo {
|
|||||||
|
|
||||||
double n = nonce.number();
|
double n = nonce.number();
|
||||||
{
|
{
|
||||||
double *ln = lastNonce.get();
|
double *ln = lastNonce.release();
|
||||||
|
|
||||||
if( ln == 0 || n != *ln ) {
|
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';
|
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";
|
errmsg = "auth fails";
|
||||||
|
Loading…
Reference in New Issue
Block a user