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

DurableViewCatalog shouldn't throw on null byte in view ns

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      Hide

      > db.createCollection("coll")
      { "ok" : 1 }
      > db.system.views.insert({_id: "\0"})
      WriteResult({ "nInserted" : 1 })
      > db.getCollectionInfos()
      2017-02-27T11:46:56.558-0500 E QUERY    [main] Error: listCollections failed: {
      	"ok" : 0,
      	"errmsg" : "namespaces cannot have embedded null characters",
      	"code" : 73,
      	"codeName" : "InvalidNamespace"
      } :
      _getErrorWithCode@src/mongo/shell/utils.js:25:13
      DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:805:1
      DB.prototype.getCollectionInfos@src/mongo/shell/db.js:817:19
      @(shell):1:1
      

      Show
      > db.createCollection("coll") { "ok" : 1 } > db.system.views.insert({_id: "\0"}) WriteResult({ "nInserted" : 1 }) > db.getCollectionInfos() 2017-02-27T11:46:56.558-0500 E QUERY [main] Error: listCollections failed: { "ok" : 0, "errmsg" : "namespaces cannot have embedded null characters", "code" : 73, "codeName" : "InvalidNamespace" } : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:805:1 DB.prototype.getCollectionInfos@src/mongo/shell/db.js:817:19 @(shell):1:1
    • Sprint:
      Query 2017-03-27
    • Linked BF Score:
      0

      Description

      Inserting a null byte into a system.views namespace is allowed but should cause operations against that view to fail with InvalidViewDefinition. It should also not prevent mongod startup, which is the case here.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: