[SERVER-15441] User management shell helpers depend on "db" global Created: 29/Sep/14  Updated: 03/Mar/15  Resolved: 02/Oct/14

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.4
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Steps To Reproduce:

var user1 = {user: "user1", pwd: "user1", roles: ["read"]};
db.getSiblingDB("test").addUser(user1);
db.getUsers();
db.getSiblingDB("test").auth("user1","user1")
use admin
db.getSiblingDB("test").changeUserPassword("user1","xyz")
db.getSiblingDB("test").getUsers()
db.getSiblingDB("test").auth("user1","xyz")
db.getSiblingDB("test").auth("user1","user1")

Participants:

 Description   

This can cause weird behaviors if "db" isn't set or is set to a database different than the handle being used to run the helpers.



 Comments   
Comment by Githook User [ 02/Oct/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-15441 Prevent user management shell helpers from accessing "db" global
Branch: master
https://github.com/mongodb/mongo/commit/76bdc368ab62f4341fd9c24928ab8af80f7130d3

Generated at Thu Feb 08 03:38:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.