summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/Glacier2Router.cpp38
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp39
2 files changed, 73 insertions, 4 deletions
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp
index bf2a3ca3bc5..7f5b25d72bb 100644
--- a/cpp/src/Glacier2/Glacier2Router.cpp
+++ b/cpp/src/Glacier2/Glacier2Router.cpp
@@ -193,7 +193,23 @@ Glacier2::RouterService::start(int argc, char* argv[])
ObjectPrx obj;
try
{
- obj = communicator()->propertyToProxy(verifierProperty);
+ try
+ {
+ obj = communicator()->propertyToProxy(verifierProperty);
+ }
+ catch(const Ice::ProxyParseException&)
+ {
+ //
+ // Check if the property is just the identity of the null permissions verifier
+ // (the identity might contain spaces which would prevent it to be parsed as a
+ // proxy).
+ //
+ if(communicator()->stringToIdentity(verifierPropertyValue) == nullPermVerifId)
+ {
+ obj = communicator()->stringToProxy("\"" + verifierPropertyValue + "\"");
+ }
+ }
+
if(!obj)
{
error("permissions verifier `" + verifierPropertyValue + "' is invalid");
@@ -207,6 +223,7 @@ Glacier2::RouterService::start(int argc, char* argv[])
error("permissions verifier `" + verifierPropertyValue + "' is invalid:\n" + ostr.str());
return false;
}
+
if(obj->ice_getIdentity() == nullPermVerifId)
{
verifier = PermissionsVerifierPrx::uncheckedCast(
@@ -332,7 +349,23 @@ Glacier2::RouterService::start(int argc, char* argv[])
ObjectPrx obj;
try
{
- obj = communicator()->propertyToProxy(sslVerifierProperty);
+ try
+ {
+ obj = communicator()->propertyToProxy(sslVerifierProperty);
+ }
+ catch(const Ice::ProxyParseException&)
+ {
+ //
+ // Check if the property is just the identity of the null permissions verifier
+ // (the identity might contain spaces which would prevent it to be parsed as a
+ // proxy).
+ //
+ if(communicator()->stringToIdentity(sslVerifierPropertyValue) == nullSSLPermVerifId)
+ {
+ obj = communicator()->stringToProxy("\"" + sslVerifierPropertyValue + "\"");
+ }
+ }
+
if(!obj)
{
error("ssl permissions verifier `" + verifierPropertyValue + "' is invalid");
@@ -346,6 +379,7 @@ Glacier2::RouterService::start(int argc, char* argv[])
error("ssl permissions verifier `" + sslVerifierPropertyValue + "' is invalid:\n" + ostr.str());
return false;
}
+
if(obj->ice_getIdentity() == nullSSLPermVerifId)
{
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index 663a3173691..cc28c63e8f2 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -1049,7 +1049,24 @@ RegistryI::getPermissionsVerifier(const ObjectAdapterPtr& adapter,
{
try
{
- verifier = _communicator->propertyToProxy(verifierProperty);
+ try
+ {
+ verifier = _communicator->propertyToProxy(verifierProperty);
+ }
+ catch(const ProxyParseException&)
+ {
+ //
+ // Check if the property is just the identity of the null permissions verifier
+ // (the identity might contain spaces which would prevent it to be parsed as a
+ // proxy).
+ //
+ if(_communicator->stringToIdentity(verifierPropertyValue) ==
+ _nullPermissionsVerifier->ice_getIdentity())
+ {
+ verifier = _communicator->stringToProxy("\"" + verifierPropertyValue + "\"");
+ }
+ }
+
if(!verifier)
{
Error out(_communicator->getLogger());
@@ -1057,6 +1074,7 @@ RegistryI::getPermissionsVerifier(const ObjectAdapterPtr& adapter,
return 0;
}
assert(_nullPermissionsVerifier);
+
if(verifier->ice_getIdentity() == _nullPermissionsVerifier->ice_getIdentity())
{
verifier = _nullPermissionsVerifier;
@@ -1154,7 +1172,24 @@ RegistryI::getSSLPermissionsVerifier(const IceGrid::LocatorPrx& locator, const s
{
try
{
- verifier = _communicator->propertyToProxy(verifierProperty);
+ try
+ {
+ verifier = _communicator->propertyToProxy(verifierProperty);
+ }
+ catch(const ProxyParseException&)
+ {
+ //
+ // Check if the property is just the identity of the null permissions verifier
+ // (the identity might contain spaces which would prevent it to be parsed as a
+ // proxy).
+ //
+ if(_communicator->stringToIdentity(verifierPropertyValue) ==
+ _nullSSLPermissionsVerifier->ice_getIdentity())
+ {
+ verifier = _communicator->stringToProxy("\"" + verifierPropertyValue + "\"");
+ }
+ }
+
if(!verifier)
{
Error out(_communicator->getLogger());