[SERVER-23297] strings that are ns's should be validated by the NamespaceString class Created: 22/Mar/16  Updated: 26/Apr/16  Resolved: 12/Apr/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 3.3.3
Fix Version/s: 3.3.5

Type: Bug Priority: Minor - P4
Reporter: Robert Guo (Inactive) Assignee: Robert Guo (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 13 (04/22/16)
Participants:

 Description   

Validation for namespace strings are currently scattered throughout the codebase, some of which make incorrect assumptions. We should encapsulate the checks by having them call methods on NamespaceString.

Here's a few of them:

➜  mongo git:(master) ✗ ack "find\('\\\$'\)"
 
db/catalog/collection.cpp
208:    if (_ns.ns().find('$') != string::npos) {
 
db/dbcommands.cpp
473:        if (nsToDrop.find('$') != string::npos) {
 
db/query/get_executor.cpp
650:        if (nss.ns().find('$') != string::npos) {
 
db/storage/mmap_v1/record_store_v1_base.cpp
259:    if (delRecLength >= 32 * 1024 && _ns.find('$') != string::npos && !isCapped()) {



 Comments   
Comment by Githook User [ 12/Apr/16 ]

Author:

{u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robert.guo@10gen.com'}

Message: SERVER-23297 consolidate namespace validation
Branch: master
https://github.com/mongodb/mongo/commit/89a3de326d0e6a999149e7eca5fbab5c77f559b6

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