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

Overly eager check for .system. in collection names causes error / assertion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      db.tmp.mr.system.users_1882.insert({a:1})
      

      Show
      db.tmp.mr.system.users_1882.insert({a:1})

      Description

      Appears to be the result of the code in insert.cpp in userAllowedCreateNS

      Specifically

       if (coll.find(".system.") != string::npos) {
      // this matches old (2.4 and older) behavior, but I'm not sure its a good idea
              return Status(ErrorCodes::BadValue,
                            str::stream() << "cannot write to '" << db << "." << coll << "'");
      }
      

      This conditional looks for .system. anywhere in a collection name.

      It appears to have caught a user supplied collection name of tmp.mr.system.users_1882

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              steffan.mejia Steffan Mejia
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: