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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: 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})
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Steffan Mejia
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: