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

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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide
      db.tmp.mr.system.users_1882.insert({a:1})
      
      Show
      db.tmp.mr.system.users_1882.insert({a:1})

      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

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

              Created:
              Updated:
              Resolved: