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

boli
04.05.2007 a225425591f3f062b1a837c1cf5dd8b9516ad674
Setting log file permissions causes problems on Windows systems. This feature is disabled until further testing is performed.
2 files modified
39 ■■■■ changed files
opends/src/server/org/opends/server/loggers/MultifileTextWriter.java 23 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/messages/LoggerMessages.java 16 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/loggers/MultifileTextWriter.java
@@ -182,10 +182,29 @@
      writer = new BufferedWriter(osw, bufferSize);
    }
    // Try to apply file permissions. Causing problems with installer. Fix
    // after 0.8.
    /*
    if(FilePermission.canSetPermissions())
    {
      FilePermission.setPermissions(file, filePermissions);
    }
      try
      {
        if(!FilePermission.setPermissions(file, filePermissions))
        {
          throw new Exception();
        }
      }
      catch(Exception e)
      {
        // Log an warning that the permissions were not set.
        int msgID = MSGID_LOGGER_SET_PERMISSION_FAILED;
        String message = getMessage(msgID, file.toString());
        logError(ErrorLogCategory.CONFIGURATION,
                 ErrorLogSeverity.SEVERE_WARNING,
                 message, msgID);
      }
    }*/
  }
opends/src/server/org/opends/server/messages/LoggerMessages.java
@@ -101,7 +101,7 @@
    /**
  /**
   * The message ID for the message that will be used if the specified
   * string is not a valid error override severity. This takes the name
   * of the invalid severity as the argument.
@@ -112,6 +112,16 @@
  /**
   * The message ID for the message that will be used if an error occured
   * while setting file permissions on a log file. This takes the name of the
   * file as the argument.
   */
  public static final int MSGID_LOGGER_SET_PERMISSION_FAILED =
        CATEGORY_MASK_LOG | SEVERITY_MASK_MILD_WARNING | 8;
  /**
   * Associates a set of generic messages with the message IDs defined in this
   * class.
   */
@@ -131,7 +141,9 @@
    registerMessage(MSGID_ERROR_LOGGER_INVALID_CATEGORY,
                    "Invalid error log category %s");
    registerMessage(MSGID_ERROR_LOGGER_INVALID_OVERRIDE_SEVERITY,
                    "invalid override of severity level %s");
                    "Invalid override of severity level %s");
    registerMessage(MSGID_LOGGER_SET_PERMISSION_FAILED,
                    "Unable to set file permissions for the log file %s");
  }
}