Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2948

Add default empty string value for fields in MergeAuthzCollections command

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • 100.8.1
    • Affects Version/s: None
    • Component/s: mongorestore
    • None
    • 1,178

      SERVER-51866 introduced a small bug where the default empty string value for the `tempUsersCollection` and `tempRolesCollection` fields is not recognized, making both fields required. So if a mongorestore user wants to restore only the database users or only the database roles, they'll get the error described inĀ TOOLS-2946.

      Even though the server bug is fixed in SERVER-59515, we should make a redundant fix to maximize coverage for users with non-backported 4.9.0+ server binaries. We just need to add the default empty string value to the arguments if either the `users` or `roles` intents are null in (*MongoRestore).RestoreUsersOrRoles, i.e.

      bson.E{
          Key:   "tempUsersCollection", // and "tempRolesCollection" separately
          Value: "",
      }

            Assignee:
            Unassigned Unassigned
            Reporter:
            evgeni.dobranov@mongodb.com Evgeni Dobranov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: