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

jvergara
25.34.2008 7be00c19c4cafc2678d1867d0702b981296cab87
Check that the path where we must store the equivalent command-lines is not an existing directory.
2 files modified
14 ■■■■■ changed files
opends/src/messages/messages/dsconfig.properties 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java 10 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/dsconfig.properties
@@ -462,3 +462,7 @@
 %s.  Error details:  %s
SEVERE_ERR_DSCFG_CANNOT_WRITE_EQUIVALENT_COMMAND_LINE_FILE_155=Cannot write \
 to file %s.  Verify that you have access rights to that file
SEVERE_ERR_DSCFG_EQUIVALENT_COMMAND_LINE_FILE_DIRECTORY_156=The specified \
 path %s to write the equivalent command is a directory.  You must specify a \
 path to a file
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -36,6 +36,7 @@
import static org.opends.server.util.StaticUtils.*;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
@@ -759,6 +760,15 @@
        println(ERR_DSCFG_CANNOT_WRITE_EQUIVALENT_COMMAND_LINE_FILE.get(file));
        return 1;
      }
      else
      {
        File f = new File(file);
        if (f.isDirectory())
        {
          println(ERR_DSCFG_EQUIVALENT_COMMAND_LINE_FILE_DIRECTORY.get(file));
          return 1;
        }
      }
    }
    // Make sure that management context's arguments are valid.