renameCollection should only require auth on source and dest DBs, not admin SERVER-1061
Still technically an admin command and requires running against admin db
This commit is contained in:
@@ -613,6 +613,7 @@ namespace mongo {
|
||||
virtual bool adminOnly() const {
|
||||
return true;
|
||||
}
|
||||
virtual bool requiresAuth() { return false; } // do our own auth
|
||||
virtual bool slaveOk() const {
|
||||
return false;
|
||||
}
|
||||
@@ -634,7 +635,7 @@ namespace mongo {
|
||||
bool capped = false;
|
||||
long long size = 0;
|
||||
{
|
||||
Client::Context ctx( source );
|
||||
Client::Context ctx( source ); // auths against source
|
||||
NamespaceDetails *nsd = nsdetails( source.c_str() );
|
||||
uassert( 10026 , "source namespace does not exist", nsd );
|
||||
capped = nsd->capped;
|
||||
@@ -643,7 +644,7 @@ namespace mongo {
|
||||
size += i.ext()->length;
|
||||
}
|
||||
|
||||
Client::Context ctx( target );
|
||||
Client::Context ctx( target ); //auths against target
|
||||
|
||||
if ( nsdetails( target.c_str() ) ) {
|
||||
uassert( 10027 , "target namespace exists", cmdObj["dropTarget"].trueValue() );
|
||||
|
||||
Reference in New Issue
Block a user