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

boli
11.24.2006 944def16fd96af13d1aa0c618ac24b1d794faa7c
Added checks to see if file permissions can be set on the platform before setting file permissions on the directory containing the database files. No errors are produced if there are no way to set the file permissions (ie. Windows and Java < 6.0).

Fix for issue 1005
1 files modified
6 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/RootContainer.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/RootContainer.java
@@ -146,6 +146,8 @@
                    EnvironmentConfig envConfig) throws DatabaseException
  {
    // Get the backend database backendDirectory permissions and apply
    if(FilePermission.canSetPermissions())
    {
    try
    {
      if(!FilePermission.setPermissions(backendDirectory, backendPermission))
@@ -161,6 +163,7 @@
      logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.SEVERE_WARNING,
               message, msgID);
    }
    }
    // Open the database environment
    env = new Environment(backendDirectory,
@@ -559,7 +562,8 @@
    FilePermission oldPermission = config.getBackendPermission();
    FilePermission newPermission = newConfig.getBackendPermission();
    if(!FilePermission.toUNIXMode(oldPermission).equals(
    if(FilePermission.canSetPermissions() &&
        !FilePermission.toUNIXMode(oldPermission).equals(
        FilePermission.toUNIXMode(newPermission)))
    {
      try