diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Freeze/BackgroundSaveEvictorI.h | 16 | ||||
-rw-r--r-- | cpp/src/Freeze/MapI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp | 40 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Ice/RetryQueue.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/WSConnector.h | 4 | ||||
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGridLib/PluginFacadeI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IcePatch2Lib/Makefile | 8 | ||||
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 10 | ||||
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 10 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 18 | ||||
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 27 | ||||
-rw-r--r-- | cpp/src/slice2js/Gen.cpp | 10 |
16 files changed, 63 insertions, 116 deletions
diff --git a/cpp/src/Freeze/BackgroundSaveEvictorI.h b/cpp/src/Freeze/BackgroundSaveEvictorI.h index a328f1ecb8a..f3af1e6e475 100644 --- a/cpp/src/Freeze/BackgroundSaveEvictorI.h +++ b/cpp/src/Freeze/BackgroundSaveEvictorI.h @@ -15,19 +15,6 @@ namespace Freeze { - -#if defined(_MSC_VER) && (_MSC_VER <= 1200) || defined(__IBMCPP__) - - enum - { - clean = 0, - created = 1, - modified = 2, - destroyed = 3, - dead = 4 - }; - -#else // // Clean object; can become modified or destroyed // @@ -55,9 +42,6 @@ namespace Freeze // static const Ice::Byte dead = 4; -#endif - - class BackgroundSaveEvictorI; struct BackgroundSaveEvictorElement; diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp index a12ef25b0b8..a94c79e6d5c 100644 --- a/cpp/src/Freeze/MapI.cpp +++ b/cpp/src/Freeze/MapI.cpp @@ -2093,28 +2093,28 @@ Freeze::MapIndexI::secondaryKeyCreate(Db* /*secondary*/, const Dbt* /*dbKey*/, c // Print for the various exception types. // void -Freeze::DeadlockException::ice_print(ostream& out) const +Freeze::DeadlockException::ice_print(std::ostream& out) const { Exception::ice_print(out); out << ":\ndatabase deadlock:\n" << message; } void -Freeze::NotFoundException::ice_print(ostream& out) const +Freeze::NotFoundException::ice_print(std::ostream& out) const { Exception::ice_print(out); out << ":\ndatabase record not found:\n" << message; } void -Freeze::DatabaseException::ice_print(ostream& out) const +Freeze::DatabaseException::ice_print(std::ostream& out) const { Exception::ice_print(out); out << ":\n" << message; } void -Freeze::IndexNotFoundException::ice_print(ostream& out) const +Freeze::IndexNotFoundException::ice_print(std::ostream& out) const { Exception::ice_print(out); out << ":\ncould not find index \"" << indexName << "\" on map \"" << mapName << "\""; diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp index af9630db528..9bc1ea38a5c 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp +++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp @@ -14,8 +14,9 @@ #include <IceUtil/FileUtil.h> #include <IceUtil/StringUtil.h> #include <IceUtil/InputUtil.h> +#include <IceUtil/Mutex.h> -#if defined(__GLIBC__) +#if defined(__GLIBC__) || defined(_AIX) # include <crypt.h> #elif defined(__APPLE__) # include <CoreFoundation/CoreFoundation.h> @@ -44,6 +45,7 @@ public: private: const map<string, string> _passwords; + IceUtil::Mutex _cryptMutex; // for old thread-unsafe crypt() }; class CryptPermissionsVerifierPlugin : public Ice::Plugin @@ -51,12 +53,12 @@ class CryptPermissionsVerifierPlugin : public Ice::Plugin public: CryptPermissionsVerifierPlugin(const CommunicatorPtr&); - + virtual void initialize(); virtual void destroy(); private: - + CommunicatorPtr _communicator; }; @@ -165,7 +167,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& struct crypt_data data; data.initialized = 0; return p->second == crypt_r(password.c_str(), salt.c_str(), &data); -#elif defined(__APPLE__) || defined(_WIN32) +#elif defined(__APPLE__) || defined(_WIN32) // // Pbkdf2 string format: // @@ -174,7 +176,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& // size_t beg = 0; size_t end = 0; - + // // Determine the digest algorithm // @@ -373,7 +375,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& vector<BYTE> passwordBuffer(password.begin(), password.end()); - DWORD status = BCryptDeriveKeyPBKDF2(algorithmHandle, &passwordBuffer[0], + DWORD status = BCryptDeriveKeyPBKDF2(algorithmHandle, &passwordBuffer[0], static_cast<DWORD>(passwordBuffer.size()), &saltBuffer[0], saltLength, rounds, &checksumBuffer1[0], static_cast<DWORD>(checksumLength), 0); @@ -388,7 +390,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& DWORD checksumBuffer2Length = checksumLength; vector<BYTE> checksumBuffer2(checksumLength); - if(!CryptStringToBinary(checksum.c_str(), static_cast<DWORD>(checksum.size()), + if(!CryptStringToBinary(checksum.c_str(), static_cast<DWORD>(checksum.size()), CRYPT_STRING_BASE64, &checksumBuffer2[0], &checksumBuffer2Length, 0, 0)) { @@ -397,7 +399,17 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& return checksumBuffer1 == checksumBuffer2; # endif #else -# error Password hashing not implemented + // Fallback to plain crypt() - DES-style + + if(p->second.size() != 13) + { + return false; + } + string salt = p->second.substr(0, 2); + + IceUtil::Mutex::Lock lock(_cryptMutex); + return p->second == crypt(password.c_str(), salt.c_str()); + #endif } @@ -412,13 +424,13 @@ CryptPermissionsVerifierPlugin::initialize() { const string prefix = "Glacier2CryptPermissionsVerifier."; const PropertyDict props = _communicator->getProperties()->getPropertiesForPrefix(prefix); - + if(!props.empty()) { ObjectAdapterPtr adapter = _communicator->createObjectAdapter(""); // colloc-only adapter - + // Each prop represents a property to set + the associated password file - + for(PropertyDict::const_iterator p = props.begin(); p != props.end(); ++p) { string name = p->first.substr(prefix.size()); @@ -426,9 +438,9 @@ CryptPermissionsVerifierPlugin::initialize() id.name = IceUtil::generateUUID(); id.category = "Glacier2CryptPermissionsVerifier"; ObjectPrx prx = adapter->add(new CryptPermissionsVerifierI(retrievePasswordMap(p->second)), id); - _communicator->getProperties()->setProperty(name, _communicator->proxyToString(prx)); + _communicator->getProperties()->setProperty(name, _communicator->proxyToString(prx)); } - + adapter->activate(); } } @@ -463,7 +475,7 @@ createCryptPermissionsVerifier(const CommunicatorPtr& communicator, const string out << "Plugin " << name << ": too many arguments"; return 0; } - + return new CryptPermissionsVerifierPlugin(communicator); } diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index c08a021c02f..27826fd75f5 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -61,7 +61,7 @@ # include <sys/types.h> #endif -#if defined(__linux) || defined(__sun) +#if defined(__linux) || defined(__sun) || defined(_AIX) # include <grp.h> // for initgroups #endif diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index e424f9c7794..2152d955cbd 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -480,6 +480,11 @@ Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, St ex.reason = out.str(); throw ex; } +#ifdef __IBMCPP__ + // xlC warns when casting a void* to function pointer +#pragma report(disable, "1540-0216") +#endif + factory = reinterpret_cast<PLUGIN_FACTORY>(sym); } diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp index aff3ff67f96..c9513f1710c 100644 --- a/cpp/src/Ice/RetryQueue.cpp +++ b/cpp/src/Ice/RetryQueue.cpp @@ -116,7 +116,7 @@ IceInternal::RetryQueue::destroy() Lock sync(*this); assert(_instance); - set<RetryTaskPtr>::const_iterator p = _requests.begin(); + set<RetryTaskPtr>::iterator p = _requests.begin(); while(p != _requests.end()) { if(_instance->timer()->cancel(*p)) diff --git a/cpp/src/Ice/WSConnector.h b/cpp/src/Ice/WSConnector.h index 17c002a8db0..3c26a06ab45 100644 --- a/cpp/src/Ice/WSConnector.h +++ b/cpp/src/Ice/WSConnector.h @@ -33,12 +33,12 @@ public: virtual bool operator!=(const Connector&) const; virtual bool operator<(const Connector&) const; -private: WSConnector(const ProtocolInstancePtr&, const ConnectorPtr&, const std::string&, int, const std::string&); virtual ~WSConnector(); - friend class WSEndpoint; +private: + const ProtocolInstancePtr _instance; const ConnectorPtr _delegate; const std::string _host; diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 3f21bcc6e25..695b2bf47c1 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -664,6 +664,11 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, // // Invoke the factory function. // +#ifdef __IBMCPP__ + // xlC warns when casting a void* to function pointer +# pragma report(disable, "1540-0216") +#endif + SERVICE_FACTORY factory = reinterpret_cast<SERVICE_FACTORY>(sym); try { diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 3127ed47f83..b9aafc93d7b 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -37,7 +37,7 @@ #endif #endif -#if defined(__linux) || defined(__sun) +#if defined(__linux) || defined(__sun) || defined(_AIX) # include <grp.h> // for initgroups #endif diff --git a/cpp/src/IceGridLib/PluginFacadeI.cpp b/cpp/src/IceGridLib/PluginFacadeI.cpp index 6bcd4f92358..0b1748a852b 100644 --- a/cpp/src/IceGridLib/PluginFacadeI.cpp +++ b/cpp/src/IceGridLib/PluginFacadeI.cpp @@ -18,7 +18,7 @@ using namespace IceGrid; namespace { -RegistryPluginFacadePtr pluginFacade; +RegistryPluginFacade* pluginFacade = 0; }; @@ -38,5 +38,13 @@ IceGrid::getRegistryPluginFacade() void IceGrid::setRegistryPluginFacade(const RegistryPluginFacadePtr& facade) { - pluginFacade = facade; + if(pluginFacade) + { + pluginFacade->__decRef(); + } + pluginFacade = facade.get(); + if(pluginFacade) + { + pluginFacade->__incRef(); + } } diff --git a/cpp/src/IcePatch2Lib/Makefile b/cpp/src/IcePatch2Lib/Makefile index e8b6d4e5565..4c1f938f0ee 100644 --- a/cpp/src/IcePatch2Lib/Makefile +++ b/cpp/src/IcePatch2Lib/Makefile @@ -27,7 +27,13 @@ SDIR = $(slicedir)/IcePatch2 include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I. -I.. $(CPPFLAGS) $(BZIP2_FLAGS) -Wno-deprecated-declarations +CPPFLAGS := -I. -I.. $(CPPFLAGS) $(BZIP2_FLAGS) + +ifeq ($(GCC_COMPILER),yes) + CPPFLAGS := $(CPPFLAGS) -Wno-deprecated-declarations +endif + + SLICE2CPPFLAGS := --ice --include-dir IcePatch2 --dll-export ICE_PATCH2_API $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(BZIP2_LIBS) diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 4848dfcbcff..0caebc4ef4d 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -518,17 +518,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) // ClassList allBases = p->allBases(); StringList ids; -#if defined(__IBMCPP__) && defined(NDEBUG) -// -// VisualAge C++ 6.0 does not see that ClassDef is a Contained, -// when inlining is on. The code below issues a warning: better -// than an error! -// - transform(allBases.begin(), allBases.end(), back_inserter(ids), - IceUtil::constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(scoped); other.push_back("::Ice::Object"); diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index 3639a53b185..6364e88133e 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -245,17 +245,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) // ClassList allBases = p->allBases(); StringList ids; -#if defined(__IBMCPP__) && defined(NDEBUG) -// -// VisualAge C++ 6.0 does not see that ClassDef is a Contained, -// when inlining is on. The code below issues a warning: better -// than an error! -// - transform(allBases.begin(), allBases.end(), back_inserter(ids), - IceUtil::constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(scoped); other.push_back("::Ice::Object"); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 05de885e742..6da3a90e809 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3088,16 +3088,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList allBases = p->allBases(); StringList ids; -#if defined(__IBMCPP__) && defined(NDEBUG) -// -// VisualAge C++ 6.0 does not see that ClassDef is a Contained, -// when inlining is on. The code below issues a warning: better -// than an error! -// - transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -3211,16 +3202,9 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!allOps.empty()) { StringList allOpNames; -#if defined(__IBMCPP__) && defined(NDEBUG) -// -// See comment for transform above -// - transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), - ::IceUtil::constMemFun<string,Operation>(&Contained::name)); -#else transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); -#endif + allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 76ef3049cbc..59c2ccae3ad 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -714,18 +714,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) StringList ids; ClassList bases = p->bases(); bool hasBaseClass = !bases.empty() && !bases.front()->isInterface(); - -#if defined(__IBMCPP__) && defined(NDEBUG) - // - // VisualAge C++ 6.0 does not see that ClassDef is a Contained, - // when inlining is on. The code below issues a warning: better - // than an error! - // - transform(allBases.begin(), allBases.end(), back_inserter(ids), constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), constMemFun(&Contained::scoped)); -#endif - StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -1130,14 +1119,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) if(!allOps.empty() || (!p->isInterface() && !hasBaseClass)) { StringList allOpNames; -#if defined(__IBMCPP__) && defined(NDEBUG) - // - // See comment for transform above - // - transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), constMemFun<string,Operation>(&Contained::name)); -#else transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), constMemFun(&Contained::name)); -#endif allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); @@ -6061,16 +6043,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) string scoped = p->scoped(); ClassList allBases = p->allBases(); StringList ids; -#if defined(__IBMCPP__) && defined(NDEBUG) - // - // VisualAge C++ 6.0 does not see that ClassDef is a Contained, - // when inlining is on. The code below issues a warning: better - // than an error! - // - transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index 573d0180c67..9e55b8b65f2 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -1294,17 +1294,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) _out << ", undefined"; } -#if defined(__IBMCPP__) && defined(NDEBUG) - // - // VisualAge C++ 6.0 does not see that ClassDef is a Contained, - // when inlining is on. The code below issues a warning: better - // than an error! - // - transform(allBases.begin(), allBases.end(), back_inserter(ids), - ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(scoped); other.push_back("::Ice::Object"); |