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

Merge branch 'master' of ssh://aaron@git.10gen.com/data/gitroot/p

This commit is contained in:
Aaron 2009-01-23 11:52:52 -05:00
commit ed4ce395ad
2 changed files with 5 additions and 3 deletions

View File

@ -673,7 +673,7 @@ namespace mongo {
string errmsg;
Command *c = i->second;
AuthenticationInfo *ai = authInfo.get();
assert( ai );
uassert("unauthorized", ai->isAuthorized(database->name.c_str()) || !c->requiresAuth());
if ( c->adminOnly() && !fromRepl && strncmp(ns, "admin", p-ns) != 0 ) {
@ -695,6 +695,7 @@ namespace mongo {
}
else if ( e.type() == String ) {
AuthenticationInfo *ai = authInfo.get();
assert( ai );
uassert("unauthorized", ai->isAuthorized(database->name.c_str()));
/* { count: "collectionname"[, query: <query>] } */

View File

@ -406,8 +406,9 @@ namespace mongo {
*/
void jniCallback(Message& m, Message& out)
{
AuthenticationInfo *ai = new AuthenticationInfo();
authInfo.reset(ai);
/* we should be in the same thread as the original request, so authInfo should be available. */
AuthenticationInfo *ai = authInfo.get();
massert("no authInfo in eval", ai);
Database *clientOld = database;