summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-10-25 02:19:58 -0400
committerAde Lee <alee@redhat.com>2012-10-29 16:55:36 -0400
commit1485a05654211eec7935441b468769298782df6e (patch)
tree430ec309de3664d332ce3d2a4debe49900259fef
parent8d77b527adf2ae4b1487ec63dd4e03835180e793 (diff)
downloadpki-1485a05654211eec7935441b468769298782df6e.tar.gz
pki-1485a05654211eec7935441b468769298782df6e.tar.xz
pki-1485a05654211eec7935441b468769298782df6e.zip
Fix for ticket 384 - Incorrect profiles path referenced
-rw-r--r--base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java37
1 files changed, 20 insertions, 17 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
index b459d8ad2..72bc8d5e6 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
@@ -2304,22 +2304,15 @@ public class ProfileAdminServlet extends AdminServlet {
String config = null;
- ISubsystem subsystem = CMS.getSubsystem("ca");
- String subname = "ca";
-
- if (subsystem == null)
- subname = "ra";
-
try {
- config = CMS.getConfigStore().getString("instanceRoot") +
- "/profiles/" + subname + "/" + id + ".cfg";
+ config = CMS.getConfigStore().getString("profile." + id + ".config");
} catch (EBaseException e) {
// store a message in the signed audit log file
auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams(req));
+ LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE,
+ auditSubjectID,
+ ILogger.FAILURE,
+ auditParams(req));
audit(auditMessage);
@@ -2464,15 +2457,25 @@ public class ProfileAdminServlet extends AdminServlet {
if (subsystem == null)
subname = "ra";
+ String subpath = "/profiles/";
+
try {
- config = CMS.getConfigStore().getString("instanceRoot") + "/profiles/" + subname + "/" + id + ".cfg";
+ String version = CMS.getConfigStore().getString("cms.version");
+ if (version.indexOf('.') > -1) {
+ version = version.substring(0, version.indexOf('.'));
+ }
+ int v = Integer.parseInt(version);
+ if (v >= 10) {
+ subpath = "/ca/profiles/";
+ }
+ config = CMS.getConfigStore().getString("instanceRoot") + subpath + subname + "/" + id + ".cfg";
} catch (EBaseException e) {
// store a message in the signed audit log file
auditMessage = CMS.getLogMessage(
- LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE,
- auditSubjectID,
- ILogger.FAILURE,
- auditParams(req));
+ LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE,
+ auditSubjectID,
+ ILogger.FAILURE,
+ auditParams(req));
audit(auditMessage);