From fa6f52fecb42d9d2d79d8be2cfdcde33838c5d21 Mon Sep 17 00:00:00 2001
From: Chris Ridd <chris.ridd@forgerock.com>
Date: Wed, 22 Aug 2012 11:24:03 +0000
Subject: [PATCH] Fix OPENDJ-548 Unable to run ldap commands as any user other than root after updating java.properties
---
opendj-sdk/opends/src/server/org/opends/server/tools/JavaPropertiesTool.java | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/JavaPropertiesTool.java b/opendj-sdk/opends/src/server/org/opends/server/tools/JavaPropertiesTool.java
index 8392bc1..ce8700f 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/JavaPropertiesTool.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/JavaPropertiesTool.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.tools;
@@ -272,7 +272,9 @@
BufferedWriter writer = null;
try
{
- writer = new BufferedWriter(new FileWriter(destinationFile));
+ File f = new File(destinationFile);
+ writer = new BufferedWriter(new FileWriter(f));
+ f.setReadable(true, false);
}
catch (IOException ioe)
{
@@ -675,19 +677,19 @@
" then"+EOL+
" export OPENDJ_JAVA_BIN"+EOL+
" else"+EOL+
- " echo \"You must specify the path to a valid Java 5.0 "+
+ " echo \"You must specify the path to a valid Java 6.0 "+
"or higher version in the\""+EOL+
" echo \"properties file and then run the "+
"dsjavaproperties tool. \""+EOL+
" echo \"The procedure to follow is:\""+EOL+
- " echo \"You must specify the path to a valid Java 5.0 "+
+ " echo \"You must specify the path to a valid Java 6.0 "+
"or higher version. The \""+EOL+
" echo \"procedure to follow is:\""+EOL+
" echo \"1. Delete the file "+
"${INSTANCE_ROOT}/lib/set-java-home\""+EOL+
" echo \"2. Set the environment variable "+
"OPENDJ_JAVA_HOME to the root of a valid \""+EOL+
- " echo \"Java 5.0 installation.\""+EOL+
+ " echo \"Java 6.0 installation.\""+EOL+
" echo \"If you want to have specificjava settings for"+
" each command line you must\""+EOL+
" echo \"follow the steps 3 and 4\""+EOL+
--
Gitblit v1.10.0