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

Inconsistent error handling in user management shell helpers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc2
    • Fix Version/s: 2.6.1, 2.7.0
    • Component/s: Security, Shell
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Backport Completed:

      Description

      Issue Status as of April 15, 2014

      ISSUE SUMMARY
      User management shell helpers like dropUser(), getUser() and getRole() show inconsistent behavior when a user is not found. Specifically, getUser() and getRole() throw an exception, but dropUser() returns false.

      USER IMPACT
      Minor impact, but user interface changes slightly, which may affect users who automate or script MongoDB user management.

      WORKAROUNDS
      None.

      RESOLUTION
      Change the behavior so that getUser() and getRole() do not throw but instead return null if the user does not exist.

      AFFECTED VERSIONS
      Version 2.6.0 is affected by this bug.

      PATCHES
      The patch is included in the 2.6.1 production release.

      Original description

      Other user management helpers such as dropUser do not throw if the user is not found - dropUser just returns false. We should change getUser and getRole to simply return null if the user/role isn't found

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: