Permalink
Browse files

SERVER-3572 write lock for authenticate

  • Loading branch information...
1 parent be8931b commit f95d8d5594077358e7932a1781dad56f1dd7ad66 @dwight dwight committed Aug 12, 2011
Showing with 5 additions and 5 deletions.
  1. +4 −4 db/security.cpp
  2. 0 db/security.h
  3. +1 −1 db/security_common.h
View
8 db/security.cpp
@@ -30,15 +30,15 @@
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++ ) {
cout << "\t" << i->first << "\t" << i->second.level << '\n';
}
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;
View
0 db/security.h 100644 → 100755
File mode changed.
View
2 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);

0 comments on commit f95d8d5

Please sign in to comment.