rpms/openoffice.org/F-7 workspace.hsql1808.patch, NONE, 1.1 openoffice.org.spec, 1.1201, 1.1202
Caolan McNamara (caolanm)
fedora-extras-commits at redhat.com
Mon Dec 3 15:00:46 UTC 2007
Author: caolanm
Update of /cvs/pkgs/rpms/openoffice.org/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14258
Modified Files:
openoffice.org.spec
Added Files:
workspace.hsql1808.patch
Log Message:
Resolves: rhbz#303601 workspace.hsql1808.patch
workspace.hsql1808.patch:
--- NEW FILE workspace.hsql1808.patch ---
Index: dba/connectivity/source/drivers/hsqldb/HDriver.cxx
diff -u dba/connectivity/source/drivers/hsqldb/HDriver.cxx:1.23.48.1 dba/connectivity/source/drivers/hsqldb/HDriver.cxx:1.23.48.1.6.2
--- dba/connectivity/source/drivers/hsqldb/HDriver.cxx:1.23.48.1 Fri Aug 24 05:28:37 2007
+++ dba/connectivity/source/drivers/hsqldb/HDriver.cxx Sat Oct 20 05:21:43 2007
@@ -101,6 +101,13 @@
#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
#endif
+#ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
+#include <comphelper/namedvaluecollection.hxx>
+#endif
+#ifndef _UNOTOOLS_CONFIGNODE_HXX_
+#include <unotools/confignode.hxx>
+#endif
+
//........................................................................
namespace connectivity
{
@@ -186,6 +193,37 @@
}
//--------------------------------------------------------------------
+ namespace
+ {
+ ::rtl::OUString lcl_getPermittedJavaMethods_nothrow( const Reference< XMultiServiceFactory >& _rxORB )
+ {
+ ::rtl::OUStringBuffer aConfigPath;
+ aConfigPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" );
+ aConfigPath.append ( ODriverDelegator::getImplementationName_Static() );
+ aConfigPath.appendAscii( "/PermittedJavaMethods" );
+ ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithServiceFactory(
+ _rxORB, aConfigPath.makeStringAndClear() ) );
+
+ ::rtl::OUStringBuffer aPermittedMethods;
+ Sequence< ::rtl::OUString > aNodeNames( aConfig.getNodeNames() );
+ for ( const ::rtl::OUString* pNodeNames = aNodeNames.getConstArray();
+ pNodeNames != aNodeNames.getConstArray() + aNodeNames.getLength();
+ ++pNodeNames
+ )
+ {
+ ::rtl::OUString sPermittedMethod;
+ OSL_VERIFY( aConfig.getNodeValue( *pNodeNames ) >>= sPermittedMethod );
+
+ if ( aPermittedMethods.getLength() )
+ aPermittedMethods.append( (sal_Unicode)';' );
+ aPermittedMethods.append( sPermittedMethod );
+ }
+
+ return aPermittedMethods.makeStringAndClear();;
+ }
+ }
+
+ //--------------------------------------------------------------------
Reference< XConnection > SAL_CALL ODriverDelegator::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
{
Reference< XConnection > xConnection;
@@ -228,39 +266,49 @@
bool bIsNewDatabase = !xStorage->hasElements();
- Sequence< PropertyValue > aConvertedProperties(9);
- sal_Int32 nPos = 0;
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("storage_key"));
- ::rtl::OUString sConnPartURL = sSystemPath.copy(0,::std::max<sal_Int32>(nIndex,sSystemPath.getLength()));
- ::rtl::OUString sKey = StorageContainer::registerStorage(xStorage,sConnPartURL);
- aConvertedProperties[nPos++].Value <<= sKey;
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("storage_class_name"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.comp.hsqldb.StorageAccess"));
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fileaccess_class_name"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess"));
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.hsqldb.jdbcDriver"));
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(
+ ::comphelper::NamedValueCollection aProperties;
+
+ // properties for accessing the embedded storage
+ ::rtl::OUString sConnPartURL = sSystemPath.copy( 0, ::std::max< sal_Int32 >( nIndex, sSystemPath.getLength() ) );
+ ::rtl::OUString sKey = StorageContainer::registerStorage( xStorage, sConnPartURL );
+ aProperties.put( "storage_key", sKey );
+ aProperties.put( "storage_class_name",
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.comp.hsqldb.StorageAccess" ) ) );
+ aProperties.put( "fileaccess_class_name",
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess" ) ) );
+
+ // JDBC driver and driver's classpath
+ aProperties.put( "JavaDriverClass",
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.hsqldb.jdbcDriver" ) ) );
+ aProperties.put( "JavaDriverClassPath",
+ ::rtl::OUString(
#ifdef SYSTEM_HSQLDB
- RTL_CONSTASCII_USTRINGPARAM(HSQLDB_JAR
- " vnd.sun.star.expand:$ORIGIN/classes/sdbc_hsqldb.jar")
+ RTL_CONSTASCII_USTRINGPARAM(HSQLDB_JAR
+ " vnd.sun.star.expand:$ORIGIN/classes/sdbc_hsqldb.jar" )
#else
- RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.expand:$ORIGIN/classes/hsqldb.jar"
- " vnd.sun.star.expand:$ORIGIN/classes/sdbc_hsqldb.jar")
+ RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.expand:$ORIGIN/classes/hsqldb.jar"
+ " vnd.sun.star.expand:$ORIGIN/classes/sdbc_hsqldb.jar" )
#endif
- );
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled"));
- aConvertedProperties[nPos++].Value <<= sal_True;
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CALL IDENTITY()"));
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"));
- aConvertedProperties[nPos++].Value <<= sal_True;
+ ) );
+
+ // auto increment handling
+ aProperties.put( "IsAutoRetrievingEnabled", true );
+ aProperties.put( "AutoRetrievingStatement",
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CALL IDENTITY()" ) ) );
+ aProperties.put( "IgnoreDriverPrivileges", true );
// don't want to expose HSQLDB's schema capabilities which exist since 1.8.0RC10
- aConvertedProperties[nPos].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "default_schema" ) );
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"));
+ aProperties.put( "default_schema",
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+ // security: permitted Java classes
+ NamedValue aPermittedClasses(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hsqldb.method_class_names" ) ),
+ makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
+ );
+ aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
+
+ // readonly?
Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
if ( xProp.is() )
{
@@ -268,19 +316,20 @@
xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nMode;
if ( (nMode & ElementModes::WRITE) != ElementModes::WRITE )
{
- aConvertedProperties.realloc(nPos+1);
- aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("readonly"));
- aConvertedProperties[nPos++].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"));
+ aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
}
}
+ Sequence< PropertyValue > aConnectionArgs;
+ aProperties >>= aConnectionArgs;
+
::rtl::OUString sConnectURL(RTL_CONSTASCII_USTRINGPARAM("jdbc:hsqldb:"));
sConnectURL += sConnPartURL;
Reference<XConnection> xOrig;
try
{
- xOrig = xDriver->connect( sConnectURL, aConvertedProperties );
+ xOrig = xDriver->connect( sConnectURL, aConnectionArgs );
}
catch(const Exception& e)
{
Index: dba/connectivity/source/drivers/hsqldb/makefile.mk
diff -u dba/connectivity/source/drivers/hsqldb/makefile.mk:1.11.48.1 dba/connectivity/source/drivers/hsqldb/makefile.mk:1.11.48.1.6.1
--- dba/connectivity/source/drivers/hsqldb/makefile.mk:1.11.48.1 Fri Aug 24 05:28:49 2007
+++ dba/connectivity/source/drivers/hsqldb/makefile.mk Tue Oct 16 06:09:54 2007
@@ -105,7 +105,8 @@
$(JVMACCESSLIB) \
$(DBTOOLSLIB) \
$(JVMFWKLIB) \
- $(COMPHELPERLIB)
+ $(COMPHELPERLIB) \
+ $(UNOTOOLSLIB)
SHL1DEPN=
Index: dba/connectivity/source/drivers/jdbc/JConnection.cxx
diff -u dba/connectivity/source/drivers/jdbc/JConnection.cxx:1.5 dba/connectivity/source/drivers/jdbc/JConnection.cxx:1.5.14.2
--- dba/connectivity/source/drivers/jdbc/JConnection.cxx:1.5 Wed Jun 27 07:35:59 2007
+++ dba/connectivity/source/drivers/jdbc/JConnection.cxx Tue Oct 16 06:11:20 2007
@@ -63,6 +63,12 @@
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include <com/sun/star/lang/DisposedException.hpp>
#endif
+#ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
+#include <com/sun/star/sdbc/SQLWarning.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
#ifndef _CONNECTIVITY_SQLPARSE_HXX
#include "connectivity/sqlparse.hxx"
#endif
@@ -70,6 +76,7 @@
#include "connectivity/dbexception.hxx"
#endif
#include "java/util/Property.hxx"
+#include "java/LocalRef.hxx"
#include "resource/jdbc_log.hrc"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "jvmaccess/classpath.hxx"
@@ -80,6 +87,7 @@
#include <memory>
using namespace connectivity;
+using namespace connectivity::jdbc;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
@@ -797,14 +805,68 @@
if( out )
{
java_sql_SQLWarning_BASE warn_base(t.pEnv, out);
- return makeAny(
- static_cast< starsdbc::SQLException >(
- java_sql_SQLWarning(warn_base,*this)));
+ SQLException aAsException( static_cast< starsdbc::SQLException >( java_sql_SQLWarning( warn_base, *this ) ) );
+
+ // translate to warning
+ SQLWarning aWarning;
+ aWarning.Context = aAsException.Context;
+ aWarning.Message = aAsException.Message;
+ aWarning.SQLState = aAsException.SQLState;
+ aWarning.ErrorCode = aAsException.ErrorCode;
+ aWarning.NextException = aAsException.NextException;
+
+ return makeAny( aWarning );
}
return Any();
}
// -----------------------------------------------------------------------------
+namespace
+{
+ bool lcl_setSystemProperties_nothrow( const java::sql::ConnectionLog& _rLogger,
+ JNIEnv& _rEnv, const Sequence< NamedValue >& _rSystemProperties )
+ {
+ if ( _rSystemProperties.getLength() == 0 )
+ // nothing to do
+ return true;
+
+ LocalRef< jclass > systemClass( _rEnv );
+ jmethodID nSetPropertyMethodID = 0;
+ // retrieve the java.lang.System class
+ systemClass.set( _rEnv.FindClass( "java/lang/System" ) );
+ if ( systemClass.is() )
+ {
+ nSetPropertyMethodID = _rEnv.GetStaticMethodID(
+ systemClass.get(), "setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" );
+ }
+
+ if ( nSetPropertyMethodID == 0 )
+ return false;
+
+ for ( const NamedValue* pSystemProp = _rSystemProperties.getConstArray();
+ pSystemProp != _rSystemProperties.getConstArray() + _rSystemProperties.getLength();
+ ++pSystemProp
+ )
+ {
+ ::rtl::OUString sValue;
+ OSL_VERIFY( pSystemProp->Value >>= sValue );
+
+ _rLogger.log( LogLevel::FINER, STR_LOG_SETTING_SYSTEM_PROPERTY, pSystemProp->Name, sValue );
+
+ LocalRef< jstring > jName( _rEnv, convertwchar_tToJavaString( &_rEnv, pSystemProp->Name ) );
+ LocalRef< jstring > jValue( _rEnv, convertwchar_tToJavaString( &_rEnv, sValue ) );
+
+ _rEnv.CallStaticObjectMethod( systemClass.get(), nSetPropertyMethodID, jName.get(), jValue.get() );
+ LocalRef< jthrowable > throwable( _rEnv, _rEnv.ExceptionOccurred() );
+ if ( throwable.is() )
+ return false;
+ }
+
+ return true;
+ }
+}
+
+// -----------------------------------------------------------------------------
void java_sql_Connection::loadDriverFromProperties(
const Sequence< PropertyValue >& info, ::rtl::OUString& _rsGeneratedValueStatement,
sal_Bool& _rbAutoRetrievingEnabled, sal_Bool& _bParameterSubstitution, sal_Bool& _bIgnoreDriverPrivileges )
@@ -813,6 +875,7 @@
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
try
{
+ Sequence< NamedValue > aSystemProperties;
const PropertyValue* pJavaDriverClass = 0;
const PropertyValue* pJavaDriverClassPath = 0;
const PropertyValue* pBegin = info.getConstArray();
@@ -843,9 +906,16 @@
{
OSL_VERIFY( pBegin->Value >>= _bIgnoreDriverPrivileges );
}
+ else if(!pBegin->Name.compareToAscii("SystemProperties"))
+ {
+ OSL_VERIFY( pBegin->Value >>= aSystemProperties );
+ }
}
if ( !object && pJavaDriverClass != 0 )
{
+ if ( !lcl_setSystemProperties_nothrow( getLogger(), *t.pEnv, aSystemProperties ) )
+ ThrowLoggedSQLException( getLogger(), t.pEnv, *this );
+
// here I try to find the class for jdbc driver
java_sql_SQLException_BASE::getMyClass();
java_lang_Throwable::getMyClass();
Index: dba/connectivity/source/drivers/jdbc/JDriver.cxx
diff -u dba/connectivity/source/drivers/jdbc/JDriver.cxx:1.38 dba/connectivity/source/drivers/jdbc/JDriver.cxx:1.38.14.1
--- dba/connectivity/source/drivers/jdbc/JDriver.cxx:1.38 Wed Jun 27 07:36:14 2007
+++ dba/connectivity/source/drivers/jdbc/JDriver.cxx Tue Oct 16 06:11:20 2007
@@ -176,9 +176,26 @@
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The JDBC driver class name."))
,sal_True
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.mysql.jdbc.Driver"))
+ ,::rtl::OUString()
+ ,Sequence< ::rtl::OUString >())
+ );
+
+ aDriverInfo.push_back(DriverPropertyInfo(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The class path where to look for the JDBC driver."))
+ ,sal_True
+ ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) )
,Sequence< ::rtl::OUString >())
);
+
+ aDriverInfo.push_back(DriverPropertyInfo(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemProperties"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Additional properties to set at java.lang.System before loading the driver."))
+ ,sal_True
+ ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) )
+ ,Sequence< ::rtl::OUString >())
+ );
+
aDriverInfo.push_back(DriverPropertyInfo(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParameterNameSubstitution"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Change named parameters with '?'."))
@@ -186,6 +203,7 @@
,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
,aBooleanValues)
);
+
aDriverInfo.push_back(DriverPropertyInfo(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the privileges from the database driver."))
@@ -193,6 +211,7 @@
,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
,aBooleanValues)
);
+
aDriverInfo.push_back(DriverPropertyInfo(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Retrieve generated values."))
@@ -200,13 +219,15 @@
,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
,aBooleanValues)
);
- aDriverInfo.push_back(DriverPropertyInfo(
+
+ aDriverInfo.push_back(DriverPropertyInfo(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Auto-increment statement."))
,sal_False
,::rtl::OUString()
,Sequence< ::rtl::OUString >())
);
+
aDriverInfo.push_back(DriverPropertyInfo(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GenerateASBeforeCorrelationName"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Generate AS before table correlation names."))
Index: dba/connectivity/source/drivers/jdbc/SQLException.cxx
diff -u dba/connectivity/source/drivers/jdbc/SQLException.cxx:1.11 dba/connectivity/source/drivers/jdbc/SQLException.cxx:1.11.112.1
--- dba/connectivity/source/drivers/jdbc/SQLException.cxx:1.11 Sat Sep 16 19:49:02 2006
+++ dba/connectivity/source/drivers/jdbc/SQLException.cxx Mon Jul 30 00:22:33 2007
@@ -107,12 +107,12 @@
if( t.pEnv ){
// temporaere Variable initialisieren
- static const char * cSignature = "()Ljava/sql/Exception;";
+ static const char * cSignature = "()Ljava/sql/SQLException;";
static const char * cMethodName = "getNextException";
// Java-Call absetzen
static jmethodID mID = NULL;
if ( !mID )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );
+ mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
if( mID ){
out = t.pEnv->CallObjectMethod( object, mID);
ThrowSQLException(t.pEnv,0);
Index: dba/connectivity/source/drivers/jdbc/tools.cxx
diff -u dba/connectivity/source/drivers/jdbc/tools.cxx:1.25 dba/connectivity/source/drivers/jdbc/tools.cxx:1.25.40.1
--- dba/connectivity/source/drivers/jdbc/tools.cxx:1.25 Mon Mar 12 03:41:24 2007
+++ dba/connectivity/source/drivers/jdbc/tools.cxx Tue Oct 16 06:11:20 2007
@@ -164,6 +164,7 @@
// this is a special property to find the jdbc driver
if( pBegin->Name.compareToAscii("JavaDriverClass") &&
pBegin->Name.compareToAscii("JavaDriverClassPath") &&
+ pBegin->Name.compareToAscii("SystemProperties") &&
pBegin->Name.compareToAscii("CharSet") &&
pBegin->Name.compareToAscii("AppendTableAlias") &&
pBegin->Name.compareToAscii("GenerateASBeforeCorrelationName") &&
Index: dba/connectivity/source/inc/java/LocalRef.hxx
diff -u /dev/null dba/connectivity/source/inc/java/LocalRef.hxx:1.1.4.2
--- /dev/null Thu Oct 25 08:23:50 2007
+++ dba/connectivity/source/inc/java/LocalRef.hxx Tue Oct 16 05:59:02 2007
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef CONNECTIVITY_LOCALREF_HXX
+#define CONNECTIVITY_LOCALREF_HXX
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <jvmaccess/virtualmachine.hxx>
+
+//........................................................................
+namespace connectivity { namespace jdbc
+{
+//........................................................................
+
+ //====================================================================
+ //= LocalRef
+ //====================================================================
+ /** helper class to hold a local ref to a JNI object
+
+ Note that this class never actually calls NewLocalRef. It is assumed that all objects
+ passed are already acquired with a local ref (as it usually is the case if you obtain
+ the object from an JNI method).
+ */
+ template< typename T >
+ class LocalRef
+ {
+ public:
+ explicit LocalRef( JNIEnv& environment )
+ :m_environment( environment )
+ ,m_object( NULL )
+ {
+ }
+
+ LocalRef( JNIEnv& environment, T object )
+ :m_environment( environment )
+ ,m_object( object )
+ {
+ }
+
+ ~LocalRef()
+ {
+ reset();
+ }
+
+ T release()
+ {
+ T t = m_object;
+ m_object = NULL;
+ return t;
+ }
+
+ void set( T object ) { reset(); m_object = object; }
+
+ void reset()
+ {
+ if ( m_object != NULL )
+ {
+ m_environment.DeleteLocalRef( m_object );
+ m_object = NULL;
+ }
+ }
+
+ JNIEnv& env() const { return m_environment; }
+ T get() const { return m_object; }
+ bool is() const { return m_object != NULL; }
+
+ private:
+ LocalRef(LocalRef &); // not defined
+ void operator =(LocalRef &); // not defined
+
+ protected:
+ JNIEnv& m_environment;
+ T m_object;
+ };
+
+//........................................................................
+} } // namespace connectivity::jdbc
+//........................................................................
+
+#endif // CONNECTIVITY_LOCALREF_HXX
Index: dba/connectivity/source/inc/java/sql/ConnectionLog.hxx
diff -u dba/connectivity/source/inc/java/sql/ConnectionLog.hxx:1.2 dba/connectivity/source/inc/java/sql/ConnectionLog.hxx:1.2.14.1
--- dba/connectivity/source/inc/java/sql/ConnectionLog.hxx:1.2 Wed Jun 27 07:38:37 2007
+++ dba/connectivity/source/inc/java/sql/ConnectionLog.hxx Tue Oct 16 06:11:51 2007
@@ -115,31 +115,31 @@
}
template< typename ARGTYPE1 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 )
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
{
return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1 );
}
template< typename ARGTYPE1, typename ARGTYPE2 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 )
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
{
return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2 );
}
template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 )
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
{
return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3 );
}
template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 )
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
{
return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3, _argument4 );
}
template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 )
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
{
return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3, _argument4, _argument5 );
}
Index: dba/connectivity/source/inc/resource/jdbc_log.hrc
diff -u dba/connectivity/source/inc/resource/jdbc_log.hrc:1.2 dba/connectivity/source/inc/resource/jdbc_log.hrc:1.2.14.1
--- dba/connectivity/source/inc/resource/jdbc_log.hrc:1.2 Wed Jun 27 07:40:40 2007
+++ dba/connectivity/source/inc/resource/jdbc_log.hrc Tue Oct 16 06:12:27 2007
@@ -93,5 +93,6 @@
#define STR_LOG_META_DATA_RESULT ( STR_JDBC_LOG_MESSAGE_BASE + 53 )
#define STR_LOG_META_DATA_SUCCESS ( STR_JDBC_LOG_MESSAGE_BASE + 54 )
#define STR_LOG_THROWING_EXCEPTION ( STR_JDBC_LOG_MESSAGE_BASE + 55 )
+#define STR_LOG_SETTING_SYSTEM_PROPERTY ( STR_JDBC_LOG_MESSAGE_BASE + 56 )
#endif // CONNECTIVITY_RESOURCE_JDBC_LOG_HRC
Index: dba/connectivity/source/resource/conn_log_res.src
diff -u dba/connectivity/source/resource/conn_log_res.src:1.2 dba/connectivity/source/resource/conn_log_res.src:1.2.14.1
--- dba/connectivity/source/resource/conn_log_res.src:1.2 Wed Jun 27 07:42:14 2007
+++ dba/connectivity/source/resource/conn_log_res.src Tue Oct 16 06:12:39 2007
@@ -313,3 +313,8 @@
{
Text = "SQLException to be thrown: message: '$1$', SQLState: $2$, ErrorCode: $3$";
};
+
+String STR_LOG_SETTING_SYSTEM_PROPERTY
+{
+ Text = "setting system property \"$1$\" to value \"$2$\"";
+};
\ No newline at end of file
Index: util/comphelper/inc/comphelper/namedvaluecollection.hxx
diff -u util/comphelper/inc/comphelper/namedvaluecollection.hxx:1.6 util/comphelper/inc/comphelper/namedvaluecollection.hxx:1.6.54.1
--- util/comphelper/inc/comphelper/namedvaluecollection.hxx:1.6 Wed Jun 27 07:54:05 2007
+++ util/comphelper/inc/comphelper/namedvaluecollection.hxx Tue Oct 16 06:03:01 2007
@@ -197,6 +197,28 @@
return impl_has( _rValueName );
}
+ /** puts a value into the collection
+
+ @return <TRUE/> if and only if a value was already present previously, in
+ which case it has been overwritten.
+ */
+ template < typename VALUE_TYPE >
+ inline bool put( const sal_Char* _pAsciiValueName, const VALUE_TYPE& _rValue )
+ {
+ return impl_put( ::rtl::OUString::createFromAscii( _pAsciiValueName ), ::com::sun::star::uno::makeAny( _rValue ) );
+ }
+
+ /** puts a value into the collection
+
+ @return <TRUE/> if and only if a value was already present previously, in
+ which case it has been overwritten.
+ */
+ template < typename VALUE_TYPE >
+ inline bool put( const ::rtl::OUString& _rValueName, const VALUE_TYPE& _rValue )
+ {
+ return impl_put( _rValueName, ::com::sun::star::uno::makeAny( _rValue ) );
+ }
+
/** removes the value with the given name from the collection
@return <TRUE/> if and only if a value with the given name existed in the collection.
@@ -215,6 +237,20 @@
return impl_remove( _rValueName );
}
+ /** transforms the collection to a sequence of PropertyValues
+
+ @return
+ the number of elements in the sequence
+ */
+ sal_Int32 operator >>= ( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _out_rValues );
+
+ /** transforms the collection to a sequence of NamedValues
+
+ @return
+ the number of elements in the sequence
+ */
+ sal_Int32 operator >>= ( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _out_rValues );
+
private:
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
@@ -231,6 +267,8 @@
bool impl_has( const ::rtl::OUString& _rValueName ) const;
+ bool impl_put( const ::rtl::OUString& _rValueName, const ::com::sun::star::uno::Any& _rValue );
+
bool impl_remove( const ::rtl::OUString& _rValueName );
};
Index: util/comphelper/source/misc/namedvaluecollection.cxx
diff -u util/comphelper/source/misc/namedvaluecollection.cxx:1.7 util/comphelper/source/misc/namedvaluecollection.cxx:1.7.54.1
--- util/comphelper/source/misc/namedvaluecollection.cxx:1.7 Wed Jun 27 07:55:20 2007
+++ util/comphelper/source/misc/namedvaluecollection.cxx Tue Oct 16 06:03:35 2007
@@ -41,18 +41,17 @@
#endif
/** === begin UNO includes === **/
-#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
#include <com/sun/star/beans/NamedValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#endif
+#include <com/sun/star/beans/PropertyState.hpp>
/** === end UNO includes === **/
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
#include <hash_map>
+#include <functional>
+#include <algorithm>
//........................................................................
namespace comphelper
@@ -70,6 +69,7 @@
using ::com::sun::star::uno::cpp_queryInterface;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::beans::NamedValue;
+ using ::com::sun::star::beans::PropertyState_DIRECT_VALUE;
/** === end UNO using === **/
//====================================================================
@@ -231,6 +231,14 @@
}
//--------------------------------------------------------------------
+ bool NamedValueCollection::impl_put( const ::rtl::OUString& _rValueName, const Any& _rValue )
+ {
+ bool bHas = impl_has( _rValueName );
+ m_pImpl->aValues[ _rValueName ] = _rValue;
+ return bHas;
+ }
+
+ //--------------------------------------------------------------------
bool NamedValueCollection::impl_remove( const ::rtl::OUString& _rValueName )
{
NamedValueRepository::iterator pos = m_pImpl->aValues.find( _rValueName );
@@ -240,6 +248,43 @@
return true;
}
+ //--------------------------------------------------------------------
+ namespace
+ {
+ struct Value2PropertyValue : public ::std::unary_function< NamedValueRepository::value_type, PropertyValue >
+ {
+ PropertyValue operator()( const NamedValueRepository::value_type& _rValue )
+ {
+ return PropertyValue(
+ _rValue.first, 0, _rValue.second, PropertyState_DIRECT_VALUE );
+ }
+ };
+
+ struct Value2NamedValue : public ::std::unary_function< NamedValueRepository::value_type, NamedValue >
+ {
+ NamedValue operator()( const NamedValueRepository::value_type& _rValue )
+ {
+ return NamedValue( _rValue.first, _rValue.second );
+ }
+ };
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int32 NamedValueCollection::operator >>= ( Sequence< PropertyValue >& _out_rValues )
+ {
+ _out_rValues.realloc( m_pImpl->aValues.size() );
+ ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2PropertyValue() );
+ return _out_rValues.getLength();
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int32 NamedValueCollection::operator >>= ( Sequence< NamedValue >& _out_rValues )
+ {
+ _out_rValues.realloc( m_pImpl->aValues.size() );
+ ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2NamedValue() );
+ return _out_rValues.getLength();
+ }
+
//........................................................................
} // namespace comphelper
//........................................................................
Index: util/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
diff -u util/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs:1.38 util/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs:1.38.66.2
--- util/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs:1.38 Tue Jul 24 04:55:08 2007
+++ util/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs Sat Oct 20 05:21:21 2007
@@ -263,6 +263,7 @@
<desc>Contains a list of descriptions for user defined drivers.</desc>
</info>
</set>
+
<group oor:name="AddressBook">
<info>
<desc>Specifies the data source that can be used as an AddressBook.</desc>
@@ -298,6 +299,7 @@
</info>
</set>
</group>
+
<group oor:name="Bibliography">
<info>
<author>OS</author>
@@ -350,10 +352,12 @@
</info>
</set>
</group>
+
<group oor:name="DriverSettings">
<info>
<desc>Specifies the driver settings that are used.</desc>
</info>
+
<group oor:name="com.sun.star.comp.sdbc.MozabDriver">
<info>
<desc>Specifies the driver settings for the mozilla database driver.</desc>
@@ -573,6 +577,7 @@
</prop>
</group>
</group>
+
<group oor:name="com.sun.star.comp.sdbc.evoab.OEvoabDriver">
<info>
<desc>Specifies the driver settings for the evolution database driver.</desc>
@@ -760,6 +765,7 @@
</prop>
</group>
</group>
+
<group oor:name="com.sun.star.comp.sdbc.kab.Driver">
<info>
<desc>Specifies the driver settings for the mozilla database driver.</desc>
@@ -773,7 +779,25 @@
<value>false</value>
</prop>
</group>
+
+ <group oor:name="com.sun.star.sdbcx.comp.hsqldb.Driver">
+ <info>
+ <desc>Specifies settings for the driver accessing HSQL databases embedded into OpenOffice.org
+ database documents (.odb)</desc>
+ </info>
+ <group oor:name="PermittedJavaMethods" oor:extensible="true">
+ <info>
+ <desc>HSQLDB features calling Java code directly from SQL statements. For security
+ reasons, this is restricted to classes from the org.hsqldb.Library package,
+ the java.lang.math package, plus any methods specified in this configuraton
+ setting. If a method specification ends with .*, then all methods
+ from the respectiv package are permitted.</desc>
+ </info>
+ </group>
+ </group>
+
</group>
+
<group oor:name="FormSearchOptions">
<info>
<desc>Specifies the options for searching in forms.</desc>
Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-7/openoffice.org.spec,v
retrieving revision 1.1201
retrieving revision 1.1202
diff -u -r1.1201 -r1.1202
--- openoffice.org.spec 13 Nov 2007 07:55:01 -0000 1.1201
+++ openoffice.org.spec 3 Dec 2007 15:00:13 -0000 1.1202
@@ -136,6 +136,7 @@
Patch69: openoffice.org-2.3.0.ooo83169.colordialog.crash.patch
Patch70: openoffice.org-2.3.1.ooo81307.sw.word2.patch
Patch71: openoffice.org-2.3.0.ooo83591.vcl.checkboxes.patch
+Patch72: workspace.hsql1808.patch
%define instdir %{_libdir}/openoffice.org
@@ -1070,6 +1071,7 @@
%patch69 -p1 -b .ooo83169.colordialog.crash.patch
%patch70 -p1 -b .ooo81307.sw.word2.patch
%patch71 -p1 -b .ooo83591.vcl.checkboxes.patch
+%patch72 -p1 -b .workspace.hsql1808.patch
%if %{linkopt}
chmod a+x solenv/bin/mklinkscript.pl
@@ -2769,7 +2771,8 @@
%{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
%changelog
-* Wed Oct 31 2007 Caolan McNamara <caolanm at redhat.com> - 1:2.3.0-6.5-unreleased
+* Mon Dec 03 2007 Caolan McNamara <caolanm at redhat.com> - 1:2.3.0-6.5
+- Resolves: rhbz#303601 CVE-2007-4575 workspace.hsql1808.patch
- Resolves: rhbz#360461 openoffice.org-2.3.0.ooo83169.colordialog.crash.patch
- Resolves: openoffice.org-2.3.0.ooo83591.vcl.checkboxes.patch
- Resolves: openoffice.org-2.3.1.ooo81307.sw.word2.patch
More information about the fedora-extras-commits
mailing list