From e1e308bc4564f596bde5cd4c96b75d3b8c672e95 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 16 Jan 2013 09:04:58 +0100 Subject: Remove support for UNO_AC* bootstrap variables ...they had effectively never been used. Change-Id: I514f2b844661e144cef758eb3ce7c4607ffad635 --- cppuhelper/source/component_context.cxx | 9 +- cppuhelper/source/defaultbootstrap.cxx | 2 +- cppuhelper/source/servicefactory.cxx | 135 +--------------------------- cppuhelper/source/servicefactory_detail.hxx | 5 +- 4 files changed, 6 insertions(+), 145 deletions(-) (limited to 'cppuhelper') diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index c168aa2a32b7..18e150c528ca 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -59,7 +59,6 @@ #define SMGR_SINGLETON "/singletons/com.sun.star.lang.theServiceManager" #define TDMGR_SINGLETON "/singletons/com.sun.star.reflection.theTypeDescriptionManager" #define AC_SINGLETON "/singletons/com.sun.star.security.theAccessController" -#define AC_POLICY "/singletons/com.sun.star.security.thePolicy" #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) @@ -694,7 +693,7 @@ void ComponentContext::disposing() ::fprintf( stderr, "> disposing context %p\n", this ); #endif - Reference< lang::XComponent > xTDMgr, xAC, xPolicy; // to be disposed separately + Reference< lang::XComponent > xTDMgr, xAC; // to be disposed separately // dispose all context objects t_map::const_iterator iPos( m_map.begin() ); @@ -731,10 +730,6 @@ void ComponentContext::disposing() { xAC = xComp; } - else if ( iPos->first == AC_POLICY ) - { - xPolicy = xComp; - } else // dispose immediately { xComp->dispose(); @@ -748,8 +743,6 @@ void ComponentContext::disposing() m_xSMgr.clear(); // dispose ac try_dispose( xAC ); - // dispose policy - try_dispose( xPolicy ); // dispose tdmgr; revokes callback from cppu runtime try_dispose( xTDMgr ); diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx index d4863b323c73..9b214847b4a5 100644 --- a/cppuhelper/source/defaultbootstrap.cxx +++ b/cppuhelper/source/defaultbootstrap.cxx @@ -115,7 +115,7 @@ cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri) "/singletons/" + i->first, css::uno::makeAny(i->second[0]->info->name), true)); } - cppu::add_access_control_entries(&context_values, bs); + cppu::add_access_control_entries(&context_values); assert(!context_values.empty()); css::uno::Reference< css::uno::XComponentContext > context( createComponentContext( diff --git a/cppuhelper/source/servicefactory.cxx b/cppuhelper/source/servicefactory.cxx index 268ddaa990b4..b52148744515 100644 --- a/cppuhelper/source/servicefactory.cxx +++ b/cppuhelper/source/servicefactory.cxx @@ -40,151 +40,22 @@ using namespace ::com::sun::star::uno; namespace cppu { -/** bootstrap variables: - - UNO_AC= [mandatory] - -- mode := { on, off, dynamic-only, single-user, single-default-user } - UNO_AC_SERVICE= [optional] - -- override ac singleton service name - UNO_AC_SINGLEUSER= [optional] - -- run with this user id or with default user policy () - set UNO_AC=single-[default-]user - UNO_AC_USERCACHE_SIZE= - -- number of user permission sets to be cached - - UNO_AC_POLICYSERVICE= [optional] - -- override policy singleton service name - UNO_AC_POLICYFILE= [optional] - -- read policy out of simple text file -*/ -void add_access_control_entries( - ::std::vector< ContextEntry_Init > * values, - Bootstrap const & bootstrap ) +void add_access_control_entries( ::std::vector< ContextEntry_Init > * values ) SAL_THROW( (Exception) ) { ContextEntry_Init entry; ::std::vector< ContextEntry_Init > & context_values = *values; - OUString ac_policy; - if (bootstrap.getFrom( OUSTR("UNO_AC_POLICYSERVICE"), ac_policy )) - { - // overridden service name - // - policy singleton - entry.bLateInitService = true; - entry.name = OUSTR("/singletons/com.sun.star.security.thePolicy"); - entry.value <<= ac_policy; - context_values.push_back( entry ); - } - else if (bootstrap.getFrom( OUSTR("UNO_AC_POLICYFILE"), ac_policy )) - { - // check for file policy - // - file policy prop: file-name - if (0 != ac_policy.compareToAscii( - RTL_CONSTASCII_STRINGPARAM("file:///") )) - { - // no file url - OUString baseDir; - if ( ::osl_getProcessWorkingDir( &baseDir.pData ) - != osl_Process_E_None ) - { - OSL_ASSERT( false ); - } - OUString fileURL; - if ( ::osl_getAbsoluteFileURL( - baseDir.pData, ac_policy.pData, &fileURL.pData ) - != osl_File_E_None ) - { - OSL_ASSERT( false ); - } - ac_policy = fileURL; - } - - entry.bLateInitService = false; - entry.name = - OUSTR("/implementations/com.sun.star.security.comp.stoc.FilePolicy/" - "file-name"); - entry.value <<= ac_policy; - context_values.push_back( entry ); - // - policy singleton - entry.bLateInitService = true; - entry.name = OUSTR("/singletons/com.sun.star.security.thePolicy"); - entry.value <<= OUSTR("com.sun.star.security.comp.stoc.FilePolicy"); - context_values.push_back( entry ); - } // else policy singleton comes from storage - - OUString ac_mode; - if (! bootstrap.getFrom( OUSTR("UNO_AC"), ac_mode )) - { - ac_mode = OUSTR("off"); // default - } - OUString ac_user; - if (bootstrap.getFrom( OUSTR("UNO_AC_SINGLEUSER"), ac_user )) - { - // ac in single-user mode - if (!ac_user.isEmpty()) - { - // - ac prop: single-user-id - entry.bLateInitService = false; - entry.name = - OUSTR("/services/com.sun.star.security.AccessController/" - "single-user-id"); - entry.value <<= ac_user; - context_values.push_back( entry ); - if ( ac_mode != "single-user" ) - { - throw SecurityException( - OUSTR("set UNO_AC=single-user " - "if you set UNO_AC_SINGLEUSER=!"), - Reference< XInterface >() ); - } - } - else - { - if ( ac_mode != "single-default-user" ) - { - throw SecurityException( - OUSTR("set UNO_AC=single-default-user " - "if you set UNO_AC_SINGLEUSER=!"), - Reference< XInterface >() ); - } - } - } - - OUString ac_service; - if (! bootstrap.getFrom( OUSTR("UNO_AC_SERVICE"), ac_service )) - { - // override service name - ac_service = OUSTR("com.sun.star.security.AccessController"); // default -// ac = OUSTR("com.sun.star.security.comp.stoc.AccessController"); - } - - // - ac prop: user-cache-size - OUString ac_cache; - if (bootstrap.getFrom( OUSTR("UNO_AC_USERCACHE_SIZE"), ac_cache )) - { - // ac cache size - sal_Int32 n = ac_cache.toInt32(); - if (0 < n) - { - entry.bLateInitService = false; - entry.name = - OUSTR("/services/com.sun.star.security.AccessController/" - "user-cache-size"); - entry.value <<= n; - context_values.push_back( entry ); - } - } - // - ac prop: mode // { "off", "on", "dynamic-only", "single-user", "single-default-user" } entry.bLateInitService = false; entry.name = OUSTR("/services/com.sun.star.security.AccessController/mode"); - entry.value <<= ac_mode; + entry.value <<= OUSTR("off"); context_values.push_back( entry ); // - ac singleton entry.bLateInitService = true; entry.name = OUSTR("/singletons/com.sun.star.security.theAccessController"); - entry.value <<= ac_service; + entry.value <<= OUSTR("com.sun.star.security.AccessController"); context_values.push_back( entry ); } diff --git a/cppuhelper/source/servicefactory_detail.hxx b/cppuhelper/source/servicefactory_detail.hxx index 09c3997a2ed9..d1e8a376bcaf 100644 --- a/cppuhelper/source/servicefactory_detail.hxx +++ b/cppuhelper/source/servicefactory_detail.hxx @@ -28,13 +28,10 @@ #include "sal/types.h" namespace cppu { struct ContextEntry_Init; } -namespace rtl { class Bootstrap; } namespace cppu { -void add_access_control_entries( - std::vector< cppu::ContextEntry_Init > * values, - rtl::Bootstrap const & bootstrap) +void add_access_control_entries(std::vector< cppu::ContextEntry_Init > * values) SAL_THROW((com::sun::star::uno::Exception)); } -- cgit