From f096ddfa52dee3e327ef52ffae780436c43601e0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:43:40 +0000 Subject: import ldapjdk-4.19-1.el7 --- diff --git a/.gitignore b/.gitignore index d93bb57..711ae6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ldapjdk-4.18.tar.gz +SOURCES/ldapjdk-4.19.tar.gz diff --git a/.ldapjdk.metadata b/.ldapjdk.metadata index 750d9e9..2b5c07c 100644 --- a/.ldapjdk.metadata +++ b/.ldapjdk.metadata @@ -1 +1 @@ -5f04b6349a2e006989a75b3efa45a876546c735d SOURCES/ldapjdk-4.18.tar.gz +1cac698781bfc792198735d988da2b1a6372fc0a SOURCES/ldapjdk-4.19.tar.gz diff --git a/SOURCES/ldapjdk-4.18.pom b/SOURCES/ldapjdk-4.18.pom deleted file mode 100644 index a6b20f5..0000000 --- a/SOURCES/ldapjdk-4.18.pom +++ /dev/null @@ -1,6 +0,0 @@ - - 4.0.0 - ldapjdk - ldapjdk - 4.18 - diff --git a/SOURCES/ldapjdk-4.19.pom b/SOURCES/ldapjdk-4.19.pom new file mode 100644 index 0000000..a380a1b --- /dev/null +++ b/SOURCES/ldapjdk-4.19.pom @@ -0,0 +1,6 @@ + + 4.0.0 + ldapjdk + ldapjdk + 4.19 + diff --git a/SOURCES/ldapjdk-jarnamefix.patch b/SOURCES/ldapjdk-jarnamefix.patch deleted file mode 100644 index 7e873f1..0000000 --- a/SOURCES/ldapjdk-jarnamefix.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up ./mozilla/directory/java-sdk/build.xml.sav ./mozilla/directory/java-sdk/build.xml ---- ./mozilla/directory/java-sdk/build.xml.sav 2009-03-20 16:41:48.000000000 -0400 -+++ ./mozilla/directory/java-sdk/build.xml 2009-03-20 16:42:09.000000000 -0400 -@@ -66,8 +66,8 @@ - - -- -- -+ -+ - - diff --git a/SOURCES/ldapjdk-ldap-url-sans-host-port.patch b/SOURCES/ldapjdk-ldap-url-sans-host-port.patch deleted file mode 100644 index 2ac56b3..0000000 --- a/SOURCES/ldapjdk-ldap-url-sans-host-port.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff -r f9d7552c8188 java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java ---- a/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java Mon Aug 08 16:00:49 2016 -0600 -+++ b/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java Fri Oct 07 11:57:01 2016 -0400 -@@ -136,10 +136,10 @@ - */ - private void parseUrl(String url) throws MalformedURLException { - StringTokenizer urlParser = new StringTokenizer (url, ":/?[]", true); -- StringTokenizer markParser = new StringTokenizer (url, ":/?[]", true); - String currentToken; - String str = null; - boolean usingIPv6 = false; -+ boolean usingDefaultHostPort = false; - - try { - currentToken = urlParser.nextToken(); -@@ -175,6 +175,7 @@ - if (currentToken.equals ("/")) { - m_hostName = null; - m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -+ usingDefaultHostPort = true; - } else if (currentToken.equals (":")) { - // port number without host name is not allowed - throw new MalformedURLException ("No hostname"); -@@ -194,37 +195,38 @@ - m_hostName = currentToken; - } - -- // Set the port -- if (urlParser.countTokens() == 0) { -- m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -- return; -- } -- currentToken = urlParser.nextToken (); // either ":" or "/" -- -- if (currentToken.equals (":")) { -- try { -- m_portNumber = Integer.parseInt (urlParser.nextToken()); -- } catch (NumberFormatException nf) { -- throw new MalformedURLException ("Port not a number"); -- } catch (NoSuchElementException ex) { -- throw new MalformedURLException ("No port number"); -- } -- -+ if (usingDefaultHostPort == false) { -+ // Set the port - if (urlParser.countTokens() == 0) { -+ m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; - return; - } -- else if (! urlParser.nextToken().equals("/")) { -+ -+ // either ":","/", or the base DN if using "ldap:///" -+ currentToken = urlParser.nextToken (); -+ -+ if (currentToken.equals (":")) { -+ try { -+ m_portNumber = Integer.parseInt (urlParser.nextToken()); -+ } catch (NumberFormatException nf) { -+ throw new MalformedURLException ("Port not a number"); -+ } catch (NoSuchElementException ex) { -+ throw new MalformedURLException ("No port number"); -+ } -+ if (urlParser.countTokens() == 0) { -+ return; -+ } -+ else if (! urlParser.nextToken().equals("/")) { -+ throw new MalformedURLException (); -+ } -+ } else if (currentToken.equals ("/")) { -+ m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -+ } else { -+ // expecting ":" or "/" - throw new MalformedURLException (); - } -- -- } else if (currentToken.equals ("/")) { -- m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -- } else { -- // expecting ":" or "/" -- throw new MalformedURLException (); - } - -- - // DN - if (!urlParser.hasMoreTokens ()) { - return; diff --git a/SOURCES/ldapjdk-support-IPv6.patch b/SOURCES/ldapjdk-support-IPv6.patch deleted file mode 100644 index a62090f..0000000 --- a/SOURCES/ldapjdk-support-IPv6.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff -r 0f7c3698a961 java-sdk/ldapjdk/netscape/ldap/LDAPConnection.java ---- a/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPConnection.java Fri Feb 27 03:58:00 2015 -0500 -+++ b/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPConnection.java Mon Aug 08 12:01:38 2016 -0400 -@@ -879,12 +879,14 @@ - * @param host host name of the LDAP server to which you want to connect. - * This value can also be a space-delimited list of hostnames or - * hostnames and port numbers (using the syntax -- * hostname:portnumber). For example, you can specify -- * the following values for the host argument:
-+ * hostname:portnumber). For IPv6 enclose the address in square brackets. -+ * For example, you can specify the following values for the -+ * host argument:
- *
-      *   myhost
-      *   myhost hishost:389 herhost:5000 whathost
-      *   myhost:686 myhost:389 hishost:5000 whathost:1024
-+     *   [::1]:389 [2620:52:0:102f:5054:1ff:fe2c:e12d]:636
-      *
- * If multiple servers are specified in the host list, the connection - * setup policy specified with the ConnSetupDelay property controls -@@ -934,13 +936,32 @@ - int i = 0; - while( st.hasMoreTokens() ) { - String s = st.nextToken(); -- int colon = s.indexOf( ':' ); -- if ( colon > 0 ) { -- hostList[i] = s.substring( 0, colon ); -- portList[i] = Integer.parseInt( s.substring( colon+1 ) ); -+ int colon; -+ -+ if ( s.startsWith( "[" ) ) { -+ // We have an ipv6 address -+ int end = s.indexOf( ']' ); -+ if ( end == -1 ) { -+ throw new LDAPException ( "invalid URL for IPv6 address", -+ LDAPException.PARAM_ERROR ); -+ } -+ String remainder = s.substring( end+1 ); -+ hostList[i] = s.substring( 0, end+1 ); -+ colon = remainder.indexOf( ':' ); -+ if ( colon >= 0 ){ -+ portList[i] = Integer.parseInt( remainder.substring( colon+1 ) ); -+ } else { -+ portList[i] = defaultPort; -+ } - } else { -- hostList[i] = s; -- portList[i] = defaultPort; -+ colon = s.indexOf( ':' ); -+ if ( colon > 0 ) { -+ hostList[i] = s.substring( 0, colon ); -+ portList[i] = Integer.parseInt( s.substring( colon+1 ) ); -+ } else { -+ hostList[i] = s; -+ portList[i] = defaultPort; -+ } - } - i++; - } -diff -r 0f7c3698a961 java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java ---- a/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java Fri Feb 27 03:58:00 2015 -0500 -+++ b/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPUrl.java Mon Aug 08 12:01:38 2016 -0400 -@@ -135,9 +135,11 @@ - * (ldaps) is also supported. - */ - private void parseUrl(String url) throws MalformedURLException { -- StringTokenizer urlParser = new StringTokenizer (url, ":/?", true); -+ StringTokenizer urlParser = new StringTokenizer (url, ":/?[]", true); -+ StringTokenizer markParser = new StringTokenizer (url, ":/?[]", true); - String currentToken; - String str = null; -+ boolean usingIPv6 = false; - - try { - currentToken = urlParser.nextToken(); -@@ -160,8 +162,10 @@ - if (!currentToken.equals("/")) { - throw new MalformedURLException (); - } -- - currentToken = urlParser.nextToken(); -+ if (currentToken.equals("[")) { -+ usingIPv6 = true; -+ } - } - catch (NoSuchElementException e) { - throw new MalformedURLException (); -@@ -176,36 +180,48 @@ - throw new MalformedURLException ("No hostname"); - } else if (currentToken.equals ("?")) { - throw new MalformedURLException ("No host[:port]"); -+ } else if (usingIPv6){ -+ StringBuilder sb = new StringBuilder(); -+ while (urlParser.hasMoreElements()) { -+ currentToken = urlParser.nextToken(); -+ if (currentToken.equals("]")) { -+ break; -+ } -+ sb.append(currentToken); -+ } -+ m_hostName = sb.toString(); - } else { - m_hostName = currentToken; -+ } -+ -+ // Set the port -+ if (urlParser.countTokens() == 0) { -+ m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -+ return; -+ } -+ currentToken = urlParser.nextToken (); // either ":" or "/" -+ -+ if (currentToken.equals (":")) { -+ try { -+ m_portNumber = Integer.parseInt (urlParser.nextToken()); -+ } catch (NumberFormatException nf) { -+ throw new MalformedURLException ("Port not a number"); -+ } catch (NoSuchElementException ex) { -+ throw new MalformedURLException ("No port number"); -+ } -+ - if (urlParser.countTokens() == 0) { -- m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; - return; - } -- currentToken = urlParser.nextToken (); // either ":" or "/" -- -- if (currentToken.equals (":")) { -- try { -- m_portNumber = Integer.parseInt (urlParser.nextToken()); -- } catch (NumberFormatException nf) { -- throw new MalformedURLException ("Port not a number"); -- } catch (NoSuchElementException ex) { -- throw new MalformedURLException ("No port number"); -- } -- -- if (urlParser.countTokens() == 0) { -- return; -- } -- else if (! urlParser.nextToken().equals("/")) { -- throw new MalformedURLException (); -- } -- -- } else if (currentToken.equals ("/")) { -- m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -- } else { -- // expecting ":" or "/" -+ else if (! urlParser.nextToken().equals("/")) { - throw new MalformedURLException (); - } -+ -+ } else if (currentToken.equals ("/")) { -+ m_portNumber = m_secure ? DEFAULT_SECURE_PORT : LDAPv2.DEFAULT_PORT; -+ } else { -+ // expecting ":" or "/" -+ throw new MalformedURLException (); - } diff --git a/SOURCES/matching-rule-parsing-640750.patch b/SOURCES/matching-rule-parsing-640750.patch deleted file mode 100644 index dfa50ac..0000000 --- a/SOURCES/matching-rule-parsing-640750.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -r 45450e5b01df java-sdk/ldapjdk/netscape/ldap/LDAPSchemaElement.java ---- ./mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPSchemaElement.java Fri Feb 18 09:02:26 2011 -0700 -+++ ./mozilla/directory/java-sdk/ldapjdk/netscape/ldap/LDAPSchemaElement.java Thu Mar 10 13:51:04 2011 -0800 -@@ -544,6 +544,10 @@ - for( int i = 0; i < names.length; i++ ) { - String[] vals = getQualifier( names[i] ); - if ( (vals != null) && (vals.length > 0) ) { -+ // need a space between elements -+ if (i > 0) { -+ s += ' '; -+ } - s += names[i] + ' ' + vals[0]; - } - } diff --git a/SPECS/ldapjdk.spec b/SPECS/ldapjdk.spec index c4eb8db..bfcf5fe 100644 --- a/SPECS/ldapjdk.spec +++ b/SPECS/ldapjdk.spec @@ -3,28 +3,23 @@ %global beansname ldapbeans Name: ldapjdk -Version: 4.18 -Release: 16%{?dist} +Version: 4.19 +Release: 1%{?dist} Epoch: 0 Summary: The Mozilla LDAP Java SDK License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Development/Java -URL: http://www.mozilla.org/directory/javasdk.html -# mkdir ldapjdk-4.18 ; -# cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot Export -r LDAPJavaSDK_418 DirectorySDKSourceJava -# tar -zcf ldapjdk-4.18,tar.gz ldapjdk-4.18 -Source: http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}.tar.gz +URL: http://www-archive.mozilla.org/directory/javasdk.html +# hg archive -p ldapjdk-4.19 -r default -t tgz -I buildjsdk.txt -I java-sdk ldapjdk-4.19.tar.gz +Source: http://pki.fedoraproject.org/pki/sources/%{name}/%{version}/%{name}-%{version}.tar.gz # originally taken from http://mirrors.ibiblio.org/pub/mirrors/maven2/ldapsdk/ldapsdk/4.1/ldapsdk-4.1.pom # changed: gId, aId and version -Source1: http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}.pom -Patch0: %{name}-jarnamefix.patch -Patch1: matching-rule-parsing-640750.patch -Patch2: %{name}-support-IPv6.patch -Patch3: %{name}-ldap-url-sans-host-port.patch +Source1: http://pki.fedoraproject.org/pki/sources/%{name}/%{version}/%{name}-%{version}.pom Requires: jpackage-utils >= 0:1.5 Requires: jss BuildRequires: ant +BuildRequires: java-devel BuildRequires: jpackage-utils >= 0:1.5 BuildRequires: jss @@ -46,20 +41,15 @@ Javadoc for %{name} %prep %setup -q # Remove all bundled jars, we must build against build-system jars -rm -f ./mozilla/directory/java-sdk/ldapjdk/lib/{jss32_stub,jsse,jnet,jaas,jndi}.jar - -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +rm -f ./java-sdk/ldapjdk/lib/{jss32_stub,jsse,jnet,jaas,jndi}.jar %build # cleanup CVS dirs rm -fr $(find . -name CVS -type d) # Link to build-system BRs pwd -( cd mozilla/directory/java-sdk/ldapjdk/lib && build-jar-repository -s -p . jss4 jsse jaas jndi ) -cd mozilla/directory/java-sdk +( cd java-sdk/ldapjdk/lib && build-jar-repository -s -p . jss4 jsse jaas jndi ) +cd java-sdk if [ ! -e "$JAVA_HOME" ] ; then export JAVA_HOME="%{_jvmdir}/java" ; fi sh -x ant dist @@ -67,10 +57,10 @@ sh -x ant dist rm -rf $RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT%{_javadir} -install -m 644 mozilla/directory/java-sdk/dist/packages/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar -install -m 644 mozilla/directory/java-sdk/dist/packages/%{spname}.jar $RPM_BUILD_ROOT%{_javadir}/%{spname}.jar -install -m 644 mozilla/directory/java-sdk/dist/packages/%{filtname}.jar $RPM_BUILD_ROOT%{_javadir}/%{filtname}.jar -install -m 644 mozilla/directory/java-sdk/dist/packages/%{beansname}.jar $RPM_BUILD_ROOT%{_javadir}/%{beansname}.jar +install -m 644 java-sdk/dist/packages/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar +install -m 644 java-sdk/dist/packages/%{spname}.jar $RPM_BUILD_ROOT%{_javadir}/%{spname}.jar +install -m 644 java-sdk/dist/packages/%{filtname}.jar $RPM_BUILD_ROOT%{_javadir}/%{filtname}.jar +install -m 644 java-sdk/dist/packages/%{beansname}.jar $RPM_BUILD_ROOT%{_javadir}/%{beansname}.jar install -d -m 755 $RPM_BUILD_ROOT%{_javadir}-1.3.0 @@ -83,9 +73,9 @@ install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar -a "ldapsdk:ldapsdk" install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name} -cp -r mozilla/directory/java-sdk/dist/doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} +cp -r java-sdk/dist/doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} -%files +%files -f .mfiles %defattr(-,root,root,-) %{_javadir}/%{name}*.jar %{_javadir}/%{spname}*.jar @@ -101,6 +91,9 @@ cp -r mozilla/directory/java-sdk/dist/doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name %{_javadocdir}/%{name}/* %changelog +* Wed Mar 8 2017 Matthew Harmsen 0:4.19-1 +- Resolves: rhbz #1394372 - Rebase ldapjdk to 4.19 in RHEL-7.4 + * Mon Oct 31 2016 Matthew Harmsen 0:4.18-16 - Resolves: rhbz #1388500 - ldapjdk fails to parse ldap url with no host:port (mreynolds)