You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by John Kelly <Jo...@bellhow.com> on 1998/11/18 20:30:21 UTC

mod_jserv/3419: Relative zone and secretkey property files are relative to Java Home directory not the Server Root Directory.

>Number:         3419
>Category:       mod_jserv
>Synopsis:       Relative zone and secretkey property files are relative to Java Home directory not the Server Root Directory.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Nov 18 11:40:01 PST 1998
>Last-Modified:
>Originator:     John.Kelly@bellhow.com
>Organization:
apache
>Release:        Apache-JServ-19981116
>Environment:
Windows NT 4.0 Service Pack 3
Apache 1.3.3
Apache-JServ-19981116
jdk1.1.7
>Description:
Relative zone and secretkey property files are relative to where the Java home
directory is not the Server root directory.  For example, if my wrapper.bin is
is c:/jre1.1.7/jrew and I specify a server root of d:/ with ApJServProperties set
to conf/jserv.properties, the jserv wrapper uses ap_server_root_relative to 
qualify the path to the config file yielding d:/conf/jserv.properties.  When
the JServ class references relative files from the jserv.properties file, such
as, zone=root and root is conf/zone.properties, it does not quality the path 
at all. The class simply tries to open the file, in this case, yields
c:/zone.properties which fails.  The JServ class should resolve relative files
to either the Server Root Directory or the directory from which the 
jserv.properties file was read.
>How-To-Repeat:
yes.  Specify a server root in a different directory tree than your current
directory.
>Fix:
A quick fix is to use a path relative to the ApJServProperties files which is
passed in the init routine of the JServ class.  Thus, all relative files would
be relative to the property file or find the server root directory somehow.

Attached is a context diff for the former case for the zone file:
*** JServ.java.orig	Sun Nov 15 09:41:59 1998
--- JServ.java	Wed Nov 18 13:52:53 1998
***************
*** 280,285 ****
--- 280,289 ----
              if (confFile == null) {
                  fail("No configuration file for servlet zone " + servletZone);
              }
+ 	    if (confFile.charAt(1) != ':' && confFile.charAt(0) != '/')
+ 	      confFile = configFile.substring(0, configFile.lastIndexOf('/')) 
+                          + "/" + confFile;
+ 
              if (log.active)
                  log.log(CH_SERVLET_MANAGER, " - Configuration file: " + confFile);
  
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]