diff options
author | dwight <dwight@10gen.com> | 2011-08-12 11:23:06 -0400 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2011-08-12 11:23:06 -0400 |
commit | f95d8d5594077358e7932a1781dad56f1dd7ad66 (patch) | |
tree | 39a80e6b39c13485dc390d600bf0917e295cdfc4 | |
parent | be8931b7eee5f6efa111cd0ad8f45ccfcffca6ca (diff) | |
download | mongo-f95d8d5594077358e7932a1781dad56f1dd7ad66.tar.gz |
SERVER-3572 write lock for authenticate
-rw-r--r-- | db/security.cpp | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | db/security.h | 0 | ||||
-rw-r--r-- | db/security_common.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/db/security.cpp b/db/security.cpp index 0e317bf3fcf..b57326a8233 100644 --- a/db/security.cpp +++ b/db/security.cpp @@ -30,7 +30,7 @@ namespace mongo { bool AuthenticationInfo::_warned = false; - + /* void AuthenticationInfo::print() const { cout << "AuthenticationInfo: " << this << '\n'; for ( MA::const_iterator i=_dbs.begin(); i!=_dbs.end(); i++ ) { @@ -38,7 +38,7 @@ namespace mongo { } cout << "END" << endl; } - + */ string AuthenticationInfo::getUser( const string& dbname ) const { scoped_spinlock lk(_lock); @@ -78,9 +78,9 @@ namespace mongo { pwd = internalSecurity.pwd; } else { - static BSONObj userPattern = fromjson("{\"user\":1}"); + // static BSONObj userPattern = fromjson("{\"user\":1}"); string systemUsers = dbname + ".system.users"; - OCCASIONALLY Helpers::ensureIndex(systemUsers.c_str(), userPattern, false, "user_1"); + // OCCASIONALLY Helpers::ensureIndex(systemUsers.c_str(), userPattern, false, "user_1"); { BSONObjBuilder b; b << "user" << user; diff --git a/db/security.h b/db/security.h index 2937ef29f80..2937ef29f80 100644..100755 --- a/db/security.h +++ b/db/security.h diff --git a/db/security_common.h b/db/security_common.h index 856215539df..2f2565f3ce0 100644 --- a/db/security_common.h +++ b/db/security_common.h @@ -57,7 +57,7 @@ namespace mongo { virtual bool slaveOk() const { return true; } - virtual LockType locktype() const { return WRITE; } + virtual LockType locktype() const { return READ; } virtual void help(stringstream& ss) const { ss << "internal"; } CmdAuthenticate() : Command("authenticate") {} bool run(const string& dbname , BSONObj& cmdObj, int options, string& errmsg, BSONObjBuilder& result, bool fromRepl); |