Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23297

strings that are ns's should be validated by the NamespaceString class

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.3.5
    • Affects Version/s: 3.3.3
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • TIG 13 (04/22/16)
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      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()) {
      

            Assignee:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: