Sfoglia il codice sorgente

Bug(s) fixed: 178479
Bug Description: DSMLGW code uses non-standard sun.misc.Base64Encoder
Reviewed by: The team (Thanks!)
Fix Description: Added jakarta-commons-codec.jar to the DS build and
packaging. We will need to add this file to the bundle of dsmlgw jar
files on /share/builds/components.
Platforms tested: Fedora Core 4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Rich Megginson 20 anni fa
parent
commit
3e9312ac1c

+ 12 - 1
buildpaths.mk

@@ -122,9 +122,13 @@ ADMINUTIL_SOURCE_ROOT = $(BUILD_ROOT)/../adminutil
 SETUPUTIL_SOURCE_ROOT = $(BUILD_ROOT)/../setuputil
 #SETUPUTIL_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/setuputil
 
-# it's customary and easier to use the pre-built jars
+# it's customary and easier to use the pre-built jar
+# you can get this from www.jpackage.org as well
+# we usually get this from the admin server package which
+# gets it from the console package
 #LDAPJDK_SOURCE_DIR = $(MOZILLA_SOURCE_ROOT)
 # Crimson - crimson.jar - http://xml.apache.org/crimson/
+# you can get this from www.jpackage.org as well
 #CRIMSON_SOURCE_DIR = $(BUILD_ROOT)/../crimson
 
 ADMINSERVER_SOURCE_ROOT = $(BUILD_ROOT)/../adminserver
@@ -133,9 +137,16 @@ LDAPCONSOLE_SOURCE_ROOT = $(BUILD_ROOT)/../directoryconsole
 
 # these are the files needed to build the java components - xmltools and dsmlgw -
 # and where to get them
+# NOTE: www.jpackage.org has almost all of these, and you can configure yum or apt
+# or up2date or whatever your package manager is to pull them, which is nice because it will
+# also take care of the dependencies - http://www.jpackage.org/repos.php
 # Axis - axis.jar - http://ws.apache.org/axis/index.html - also jaxrpc.jar,saaj.jar
 # Xerces-J - xercesImpl.jar, xml-apis.jar http://xml.apache.org/xerces2-j/download.cgi
 # JAF - activation.jar - http://java.sun.com/products/javabeans/glasgow/jaf.html
+# OR
+# JAF - activation.jar or jaf.jar - http://www.jpackage.org
+# NOTE - classpathx-jaf may also work
+# Codec - jakarta-commons-codec.jar - http://jakarta.apache.org/commons/codec/
 # JWSDP - jaxrpc-api.jar,jaxrpc.jar,saaj.jar - http://java.sun.com/webservices/downloads/webservicespack.html
 # all of these files need to be in the following directory:
 DSMLGWJARS_BUILD_DIR = $(BUILD_ROOT)/../dsmlgwjars

+ 1 - 1
components.mk

@@ -555,7 +555,7 @@ AXIS = axis-$(AXIS_VERSION).zip
 AXIS_FILES = $(AXIS)
 AXIS_FILE = $(CLASS_DEST)/$(AXIS)
 
-DSMLJAR = activation.jar,jaxrpc-api.jar,jaxrpc.jar,saaj.jar,xercesImpl.jar,xml-apis.jar
+DSMLJAR = activation.jar,jaxrpc-api.jar,jaxrpc.jar,saaj.jar,xercesImpl.jar,xml-apis.jar,jakarta-commons-codec.jar
 DSMLJAR_FILE = $(CLASS_DEST)
 
 CRIMSON_LICENSE = LICENSE.crimson

+ 1 - 1
internal_comp_deps.mk

@@ -450,7 +450,7 @@ DSMLJAR_FILES = $(DSMLJAR)
 DSMLJAR_RELEASE = $(COMPONENTS_DIR)
 #DSMLJARJAR_DIR = $(DSMLJARJAR_RELEASE)/$(DSMLJARJAR_COMP)/$(DSMLJARJAR_VERSION)
 DSMLJAR_DIR = $(DSMLJAR_RELEASE)/dsmljars
-DSMLJAR_DEP = $(CLASS_DEST)/activation.jar $(CLASS_DEST)/jaxrpc-api.jar $(CLASS_DEST)/jaxrpc.jar $(CLASS_DEST)/saaj.jar $(CLASS_DEST)/xercesImpl.jar $(CLASS_DEST)/xml-apis.jar
+DSMLJAR_DEP = $(CLASS_DEST)/activation.jar $(CLASS_DEST)/jaxrpc-api.jar $(CLASS_DEST)/jaxrpc.jar $(CLASS_DEST)/saaj.jar $(CLASS_DEST)/xercesImpl.jar $(CLASS_DEST)/xml-apis.jar $(CLASS_DEST)/jakarta-commons-codec.jar
 
 ifndef DSMLJAR_PULL_METHOD
 DSMLJAR_PULL_METHOD = $(COMPONENT_PULL_METHOD)

+ 5 - 0
ldap/clients/dsmlgw/build.xml

@@ -51,16 +51,20 @@
 
 <property name="ldapjdk.jar"     value="${ldapdist.dir}/ldapjdk.jar"/>
 <property name="activation.jar"  value="${globaldist.dir}/activation.jar"/>
+<property name="jaf.jar"  value="${globaldist.dir}/jaf.jar"/>
 <property name="jaxrpc-api.jar"  value="${globaldist.dir}/jaxrpc-api.jar"/>
 <property name="jaxrpc.jar"  value="${globaldist.dir}/jaxrpc.jar"/>
 <property name="saaj.jar"  value="${globaldist.dir}/saaj.jar"/>
 <property name="xercesImpl.jar"  value="${globaldist.dir}/xercesImpl.jar"/>
 <property name="xmlParserAPIs.jar"  value="${globaldist.dir}/xml-apis.jar"/>
 <property name="axis.jar"        value="${globaldist.dir}/axis.jar"/>
+<property name="codec.jar"        value="${globaldist.dir}/jakarta-commons-codec.jar"/>
+<property environment="env"/>
 
 <path id="class.path">
 <pathelement location="${ldapjdk.jar}"/>
 <pathelement location="${activation.jar}"/>
+<pathelement location="${jaf.jar}"/>
 <pathelement location="${jaxrpc-api.jar}"/>
 <pathelement location="${jaxrpc.jar}"/> 
 <pathelement location="${saaj.jar}"/>
@@ -68,6 +72,7 @@
 <pathelement location="${xercesImpl.jar}"/> 
 <pathelement location="${xmlParserAPIs.jar}"/>
 <pathelement location="${axis.jar}"/>
+<pathelement location="${codec.jar}"/>
 </path>
 
 <property name="build.dir"      value="${mcom.root}/built/dsmlgw"/>

+ 4 - 2
ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java

@@ -36,6 +36,8 @@
  * --- END COPYRIGHT BLOCK --- */
 package com.netscape.dsml.gateway;
 
+import org.apache.commons.codec.binary.Base64;
+
 /**
  *
  * @author  elliot
@@ -53,9 +55,9 @@ public class ParseValue {
         org.w3c.dom.Node type = n.getAttributes().getNamedItem("xsi:type");
         if (type != null && type.getNodeValue().equalsIgnoreCase("xsd:base64Binary") ) {
             // This value is encoded in base64. decode it.
-            sun.misc.BASE64Decoder bd = new sun.misc.BASE64Decoder();
+            Base64 bd = new Base64();
             try {
-                ret = bd.decodeBuffer( n.getFirstChild().getNodeValue() )  ; 
+                ret = bd.decode( n.getFirstChild().getNodeValue().getBytes() )  ; 
             } 
             catch (org.w3c.dom.DOMException de) {
                 ret = "".getBytes();

+ 3 - 2
ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java

@@ -62,6 +62,7 @@ import org.apache.axis.AxisFault;
 import org.apache.axis.Message;
 import org.apache.axis.MessageContext;
 import org.apache.axis.handlers.BasicHandler;
+import org.apache.commons.codec.binary.Base64;
 
 public class gatewayHandler  extends BasicHandler {
     private HandlerInfo handlerInfo;
@@ -110,9 +111,9 @@ public class gatewayHandler  extends BasicHandler {
         if ( tmp != null && tmp.startsWith("Basic ") ) {
             
             int  i ;
-            sun.misc.BASE64Decoder bd = new sun.misc.BASE64Decoder();
+            Base64 bd = new Base64();
             try {
-                tmp = new String( (bd.decodeBuffer(tmp.substring(6)  )));
+                tmp = new String( (bd.decode(tmp.substring(6).getBytes()  )));
             }
             catch (Exception e) {
                 // couldn't decode auth info

+ 6 - 1
ldap/cm/Makefile

@@ -359,7 +359,11 @@ ifeq ($(USE_DSMLGW), 1)
 
 # now time to move the necessary jars in place
 	$(INSTALL) -m 644 $(LDAPJARFILE)  $(RELDIR)/clients/dsmlgw/WEB-INF/lib
-	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/activation.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
+	if [ -f $(DSMLGWJARS_BUILD_DIR)/jaf.jar ] ; then \
+		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaf.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib ; \
+	else \
+		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/activation.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib ; \
+	fi
 # if you use the jaxrpc.jar from the axis distribution, you don't need the api file
 # or perhaps you need the jaxrpc.jar for building, and jaxrpc-api.jar at runtime, or vice versa
 # if so, I'm not sure where to get the implementation
@@ -370,6 +374,7 @@ ifeq ($(USE_DSMLGW), 1)
 	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/saaj.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
 	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xercesImpl.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
 	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xml-apis.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
+	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jakarta-commons-codec.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
 endif # USE_DSMLGW
 
 # PACKAGE_UNDER_JAVA is defined in components.mk - these are component .jar files to install