[SERVER-4302] user shouldn't be able to create collection having a name prefixed by 'system.' Created: 17/Nov/11  Updated: 06/Dec/22  Resolved: 16/Nov/16

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Backlog - Storage Execution Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-4122 Validate database and collection name... Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

From Sridhar's email:

This was from the field and I can reproduce it as follows

I can use db.createCollection("system.foobar") to create a collection with the system prefix.

I cannot seem to drop this collection since I get
> db.system.foobar.drop()
Wed Nov 16 16:30:11 uncaught exception: drop failed: {
"ns" : "test.system.foobar",
"errmsg" : "exception: can't drop system ns",
"code" : 12502,
"ok" : 0
}

There is a check in pdfile.cpp in dropNS that checks for this



 Comments   
Comment by Eliot Horowitz (Inactive) [ 17/Nov/11 ]

Yes - there is already a list of approved ones and operations.

Comment by Chris Westin [ 17/Nov/11 ]

Won't that mean I can't (indirectly) create system.profile by turning on the profiler? How about dropping and resizing system.profile (which is a capped collection)? Are there other 'system.' collections I might need to manipulate?

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