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

boli
24.13.2007 4b4ecf5f226a9222003a115505fe0eb1e8edfc82
Fixed a issue where executing an external process using the StaticUtils.exec method might never return. This will cause the server to dead lock when setting the file permissions using the UNIX chmod command. A particular case where this may happen is during log rotation on Java 5.

Fix for issue 2116
2 files modified
8 ■■■■ changed files
opends/src/server/org/opends/server/types/FilePermission.java 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/StaticUtils.java 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/types/FilePermission.java
@@ -32,7 +32,6 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import org.opends.server.core.DirectoryServer;
@@ -590,11 +589,10 @@
      f.getAbsolutePath()
    };
    ArrayList<String> outputLines = new ArrayList<String>(1);
    int exitCode;
    try
    {
      exitCode = exec("chmod", arguments, null, null, outputLines);
      exitCode = exec("chmod", arguments, null, null, null);
    }
    catch (Exception e)
    {
opends/src/server/org/opends/server/util/StaticUtils.java
@@ -38,6 +38,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.text.ParseException;
@@ -2388,13 +2389,14 @@
    }
    else
    {
      InputStream processStream =  process.getInputStream();
      BufferedReader reader =
           new BufferedReader(new InputStreamReader(
                                       process.getInputStream()));
      try
      {
        while (true)
        while (processStream.available() > 0)
        {
          String line = reader.readLine();
          if (line == null)