From 6cff6e50e589ff91df76fafac8e0f72918b5ce5c Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Wed, 12 Jul 2006 22:23:35 +0000
Subject: [PATCH] The backends should interpret relative pathnames in the configuration file as relative to the server root rather than the current working directory.
---
opends/src/server/org/opends/server/backends/jeb/Config.java | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/Config.java b/opends/src/server/org/opends/server/backends/jeb/Config.java
index 0838f55..021afde 100644
--- a/opends/src/server/org/opends/server/backends/jeb/Config.java
+++ b/opends/src/server/org/opends/server/backends/jeb/Config.java
@@ -57,6 +57,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;
+import java.io.File;
import static org.opends.server.loggers.Debug.debugException;
@@ -223,7 +224,7 @@
/**
* The backend directory (file system pathname).
*/
- private String backendDirectory = null;
+ private File backendDirectory = null;
/**
* Number of times we should retry database transactions that get aborted
@@ -327,7 +328,12 @@
String message = getMessage(msgID, configEntry.getDN().toString());
throw new ConfigException(msgID, message);
}
- backendDirectory = backendDirectoryAttr.activeValue();
+ backendDirectory = new File(backendDirectoryAttr.activeValue());
+ if (!backendDirectory.isAbsolute())
+ {
+ backendDirectory = new File(DirectoryServer.getServerRoot(),
+ backendDirectoryAttr.activeValue());
+ }
// ds-cfg-backendIndexEntryLimit
// Optional, single-valued config attribute requiring admin action on change
@@ -701,9 +707,9 @@
/**
* Get the backend directory.
*
- * @return A string containing the pathname to the backend directory
+ * @return A file representing the backend directory
*/
- public String getBackendDirectory()
+ public File getBackendDirectory()
{
return backendDirectory;
}
--
Gitblit v1.10.0