[SERVER-13918] dropDatabase doesn't drop users for this database in 2.6 Created: 13/May/14  Updated: 10/Dec/14  Resolved: 13/May/14

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.6.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Linda Qin Assignee: Andreas Nilsson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Since users for all the databases are stored in the admin database, dropping a database using dropDatabase doesn't drop the users for this database. This looks confusing:

test@undefined> db
test
test@undefined> db.auth("u3","u3")
1
test@undefined> show users
{
	"_id" : "test.u3",
	"user" : "u3",
	"db" : "test",
	"roles" : [
		{
			"role" : "dbOwner",
			"db" : "test"
		}
	]
}
test@undefined> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
test@undefined> show users
{
	"_id" : "test.u3",
	"user" : "u3",
	"db" : "test",
	"roles" : [
		{
			"role" : "dbOwner",
			"db" : "test"
		}
	]
}


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