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

jvergara
18.03.2008 1e9ad7aa5cb6ca6b42185faf075a6c12b47aa433
Fix for issue 2822 (Config file should be read-protected)
Update the permissions of the root file of the installation (in the diffs is proposed to be 700). This is done in build.xml when generating the zip file and in the web start installer.
2 files modified
20 ■■■■ changed files
opends/build.xml 2 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/ZipExtractor.java 18 ●●●● patch | view | raw | blame | history
opends/build.xml
@@ -948,6 +948,8 @@
  <target name="package" depends="prepackage"
       description="Package the Directory Server for distribution.">
    <zip destfile="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}.zip">
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}"
           filemode="644" dirmode="700" />
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/**/*"
           excludes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/*,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_script-util.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_mixed-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade,${SHORT_NAME}-${VERSION_NUMBER_STRING}/QuickSetup.app/Contents/MacOS/JavaApplicationStub,${SHORT_NAME}-${VERSION_NUMBER_STRING}/Uninstall.app/Contents/MacOS/JavaApplicationStub,${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/StatusPanel.app/Contents/MacOS/JavaApplicationStub"
           filemode="644" dirmode="755" />
opends/src/quicksetup/org/opends/quicksetup/util/ZipExtractor.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.util;
@@ -109,7 +109,6 @@
      zipFile.getName(),
      app);
    if (!zipFile.getName().endsWith(".zip")) {
      // TODO i18n
      throw new IllegalArgumentException("File must have extension .zip");
    }
  }
@@ -158,7 +157,7 @@
   * @param destDir String representing the directory where the zip file will
   * be extracted
   * @param removeFirstPath when true removes each zip entry's initial path
   * when copied to the destination folder.  So for instance if the zip enty's
   * when copied to the destination folder.  So for instance if the zip entry's
   * name was /OpenDS-0.8/some_file the file would appear in the destination
   * directory as 'some_file'.
   * @throws ApplicationException if something goes wrong
@@ -178,7 +177,9 @@
     */
    Map<String, ArrayList<String>> permissions =
        new HashMap<String, ArrayList<String>>();
    ArrayList<String> list = new ArrayList<String>();
    list.add(destDir);
    permissions.put(getProtectedDirectoryPermissionUnix(), list);
    try {
      if(application != null)
         application.checkAbort();
@@ -329,6 +330,15 @@
  }
  /**
   * Returns the UNIX permissions to be applied to a protected directory.
   * @return the UNIX permissions to be applied to a protected directory.
   */
  private String getProtectedDirectoryPermissionUnix()
  {
    return "700";
  }
  /**
   * Returns the file system permissions for a directory.
   * @param path the directory for which we want the file permissions.
   * @return the file system permissions for the directory.