mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
05.42.2008 b3e78216a2838f9e8c7c68bdf1a1fd9f4989521d
Fix for issue #3005 (dsframework set-admin-user-properties does not work with the password of the administrator)
2 files modified
24 ■■■■■ changed files
opends/src/ads/org/opends/admin/ads/ADSContext.java 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java 20 ●●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/ADSContext.java
@@ -1271,6 +1271,8 @@
    LdapName dnCentralAdmin =
      makeDNFromAdministratorProperties(adminProperties);
    boolean updatePassword = adminProperties
        .containsKey(AdministratorProperty.PASSWORD);
    try
    {
      // Entry renaming
@@ -1307,7 +1309,7 @@
      {
        BasicAttributes attrs =
          makeAttrsFromAdministratorProperties(
              adminProperties, false, currentPrivileges);
              adminProperties, updatePassword, currentPrivileges);
        dirContext.modifyAttributes(dnCentralAdmin,
            DirContext.REPLACE_ATTRIBUTE, attrs);
      }
opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java
@@ -668,15 +668,15 @@
   *
   * @param propertySetArgument
   *          The input set argument.
   * @param checkMandatoryProps
   * @param createCall
   *          Indicates if we should check the presence of mandatory
   *          properties.
   *          properties and add root privileges.
   * @return The created map.
   * @throws ArgumentException
   *           If error error occurs during set parsing.
   */
  private Map<AdministratorProperty, Object> mapSetOptionsToMap(
      StringArgument propertySetArgument, boolean checkMandatoryProps)
      StringArgument propertySetArgument, boolean createCall)
      throws ArgumentException
  {
    HashMap<AdministratorProperty, Object> map =
@@ -768,6 +768,14 @@
      }
    }
    // If we are not in the create admin user, just return the
    // provided atributes.
    if (! createCall)
    {
      return map ;
    }
    // Here, we are in the create case.
    // If privileges was not provided by the user, set the default value
    if (! map.containsKey(AdministratorProperty.PRIVILEGE))
    {
@@ -786,12 +794,6 @@
      map.put(AdministratorProperty.PRIVILEGE,privilegesList);
    }
    // Check that all mandatory props are set.
    if (! checkMandatoryProps)
    {
      return map ;
    }
    for (AdministratorProperty s : AdministratorProperty.values())
    {
      Argument arg = userAdminProperties.get(s);