diff options
author | Brent Eagles <brent@zeroc.com> | 2006-07-05 15:41:28 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2006-07-05 15:41:28 +0000 |
commit | 13a77f86fd875d3610398c151f43bd69c17a0634 (patch) | |
tree | fff8a9937b1bbe04d79728285bd3c812f0e5987b /cpp | |
parent | Fixed bug 856 (diff) | |
download | ice-13a77f86fd875d3610398c151f43bd69c17a0634.tar.bz2 ice-13a77f86fd875d3610398c151f43bd69c17a0634.tar.xz ice-13a77f86fd875d3610398c151f43bd69c17a0634.zip |
converting ProxyLengthMax to ProxySizeMax
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/RPMTools.py | 3 | ||||
-rw-r--r-- | cpp/config/PropertyNames.def | 2 | ||||
-rw-r--r-- | cpp/doc/Properties.sgml | 15 | ||||
-rwxr-xr-x | cpp/makebindist.py | 28 | ||||
-rw-r--r-- | cpp/src/Glacier2/ProxyVerifier.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rwxr-xr-x | cpp/test/Glacier2/addressFilter/run.py | 14 |
8 files changed, 50 insertions, 40 deletions
diff --git a/cpp/RPMTools.py b/cpp/RPMTools.py index 86f504b9130..36f817360a8 100644 --- a/cpp/RPMTools.py +++ b/cpp/RPMTools.py @@ -99,8 +99,7 @@ class Package: for f in ['python >= 2.4.1', 'python-devel >= 2.4.1', 'bzip2-devel >= 1.0.2', 'bzip2-libs >= 1.0.2', 'expat-devel >= 1.9', 'expat >= 1.9', 'libstdc++ >= 3.2', 'gcc >= 3.2', 'gcc-c++ >= 3.2', 'tar', - 'binutils >= 2.10', 'openssl >= 0.9.7f', 'openssl-devel >= 0.9.7f', 'readline >= 5.0', - 'ncurses >= 5.4']: + 'binutils >= 2.10', 'openssl >= 0.9.7f', 'openssl-devel >= 0.9.7f', 'ncurses >= 5.4']: ofile.write('BuildRequires: ' + f + '\n') ofile.write('\n') diff --git a/cpp/config/PropertyNames.def b/cpp/config/PropertyNames.def index 99d5a627255..dcea7aaf6d7 100644 --- a/cpp/config/PropertyNames.def +++ b/cpp/config/PropertyNames.def @@ -379,7 +379,7 @@ Glacier2: Client.Trace.Request Filter.Address.Reject Filter.Address.Accept - Filter.ProxyLengthMax + Filter.ProxySizeMax Filter.Category.Accept Filter.AdapterId.Accept Filter.Identity.Accept diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml index 8d170e8a696..9b854803ae5 100644 --- a/cpp/doc/Properties.sgml +++ b/cpp/doc/Properties.sgml @@ -4843,20 +4843,21 @@ a leading backslash. </section> </section> -<section><title>Glacier2.Filter.ProxyLengthMax</title> +<section><title>Glacier2.Filter.ProxySizeMax</title> <section><title>Synopsis</title> <synopsis> -Glacier2.Filter.ProxyLengthMax=<replaceable>num</replaceable> +Glacier2.Filter.ProxySizeMax=<replaceable>num</replaceable> </synopsis> </section> <section> <title>Description</title> <para> -If set, the &Glacier2; router rejects requests using proxies that -contain more than <replaceable>num</replaceable> network endpoints. This -helps secure the system against attack. If unset, &Glacier2; will accept -requests using proxies that specify any number of legal network -endpoints. + +If set, the &Glacier2; router rejects requests whose stringified proxies are +longer than <replaceable>num</replaceable>. This helps secure the system +against attack. If unset, &Glacier2; will accept requests using proxies of any +length. + </para> </section> </section> diff --git a/cpp/makebindist.py b/cpp/makebindist.py index b96217c42b3..1082ef98c23 100755 --- a/cpp/makebindist.py +++ b/cpp/makebindist.py @@ -193,10 +193,16 @@ def collectSourceDistributions(tag, sourceDir, cvsdir, distro): os.chdir(cwd + "/../" + cvsdir) if len(tag) > 0: print 'Making disribution ' + cvsdir + ' with tag ' + tag - if cvsdir in ['icepy', 'ice', 'icephp']: + + # + # The sources collected by the makebindist.py script are *NOT* + # suitable for release as they do not all contain the documentation. + # + if cvsdir in ["ice", "icephp"]: runprog("./makedist.py " + tag) else: - runprog("./makedist.py " + tag) + runprog("./makedist.py -d " + tag) + shutil.copy("dist/" + distro + ".tar.gz", sourceDir) os.chdir(cwd) @@ -339,8 +345,15 @@ def extractDemos(sources, buildDir, version, distro, demoDir): Ice""" cwd = os.getcwd() os.chdir(buildDir + "/demotree") - runprog("gzip -dc " + sources + "/" + distro + ".tar.gz | tar xf - " + distro + "/demo " + distro + "/config " + distro + - "/certs", False) + + # + # TODO: Some archives don't contain all of these elements. It might + # be nicer to make the toExtract list more tailored for each + # distribution. + # + toExtract = "%s/demo %s/config %s/certs" % (distro, distro, distro) + + runprog("gzip -dc " + sources + "/" + distro + ".tar.gz | tar xf - " + toExtract, False) shutil.move(distro + "/demo", buildDir + "/Ice-" + version + "-demos/demo" + demoDir) @@ -1103,15 +1116,16 @@ def main(): toCollect = list(sourceTarBalls) for cvs, tarball, demoDir in toCollect: extractDemos(sources, buildDir, version, tarball, demoDir) - shutil.copy(installFiles + '/unix/README.DEMOS', buildDir + '/Ice-' + version + '-demos/README.DEMOS') + shutil.copy("%s/unix/README.DEMOS" % installFiles, "%s/Ice-%s-demos/README.DEMOS" % (buildDir, version)) + shutil.copy("%s/Ice-%s/ICE_LICENSE" % (buildDir, version), "%s/Ice-%s-demos/ICE_LICENSE" % (buildDir, version)) archiveDemoTree(buildDir, version, installFiles) - shutil.move(buildDir + '/Ice-' + version + '-demos.tar.gz', installDir + '/Ice-' + version + '-demos.tar.gz') + shutil.move("%s/Ice-%s-demos.tar.gz" % (buildDir, version), "%s/Ice-%s-demos.tar.gz" % (installDir, version)) # # Everything should be set for building stuff up now. # for cvs, tarball, demoDir in sourceTarBalls: - makeInstall(sources, buildDir, installDir + '/Ice-' + version, tarball, clean, version) + makeInstall(sources, buildDir, "%s/Ice-%s" % (installDir, version), tarball, clean, version) elif cvsMode: collectSources = False diff --git a/cpp/src/Glacier2/ProxyVerifier.cpp b/cpp/src/Glacier2/ProxyVerifier.cpp index 69258d49547..ea81669e51e 100644 --- a/cpp/src/Glacier2/ProxyVerifier.cpp +++ b/cpp/src/Glacier2/ProxyVerifier.cpp @@ -834,13 +834,13 @@ match(const vector<ProxyRule*>& rules, const ObjectPrx& proxy) } // -// MaxEndpointsRule returns 'true' if the proxy exceeds the configured -// number of endpoints. +// ProxyLengthRule returns 'true' if the string form of the proxy exceeds the configured +// length. // -class MaxEndpointsRule : public ProxyRule +class ProxyLengthRule : public ProxyRule { public: - MaxEndpointsRule(const CommunicatorPtr communicator, const string& count, int traceLevel) : + ProxyLengthRule(const CommunicatorPtr communicator, const string& count, int traceLevel) : _communicator(communicator), _traceLevel(traceLevel) { @@ -848,13 +848,13 @@ public: if(!(s >> _count) || !s.eof()) { InitializationException ex(__FILE__, __LINE__); - ex.reason = "Error parsing MaxEndpoints property"; + ex.reason = "Error parsing ProxySizeMax property"; throw ex; } if(_count <= 0) { InitializationException ex(__FILE__, __LINE__); - ex.reason = "MaxEndpoints must be greater than 1"; + ex.reason = "ProxySizeMax must be greater than 1"; throw ex; } } @@ -862,13 +862,13 @@ public: bool check(const ObjectPrx& p) const { - EndpointSeq endpoints = p->ice_getEndpoints(); - bool result = (endpoints.size() > _count); + string s = p->ice_toString(); + bool result = (s.size() > _count); if(_traceLevel >= 1) { Trace out(_communicator->getLogger(), "Glacier2"); out << _communicator->proxyToString(p) << (result ? " exceeds " : " meets ") - << "endpoint count restriction\n"; + << "proxy size restriction\n"; } return result; } @@ -901,10 +901,10 @@ Glacier2::ProxyVerifier::ProxyVerifier(const CommunicatorPtr& communicator, cons Glacier2::parseProperty(communicator, s, _rejectRules, _traceLevel); } - s = communicator->getProperties()->getProperty("Glacier2.Filter.ProxyLengthMax"); + s = communicator->getProperties()->getProperty("Glacier2.Filter.ProxySizeMax"); if(s != "") { - _rejectRules.push_back(new MaxEndpointsRule(communicator, s, _traceLevel)); + _rejectRules.push_back(new ProxyLengthRule(communicator, s, _traceLevel)); } } diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index aee113b62b4..be2c730bb7b 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `../config/PropertyNames.def', Fri Jun 30 14:22:37 2006 +// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Jul 5 13:10:25 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -299,7 +299,7 @@ const char* IceInternal::PropertyNames::Glacier2Props[] = "Glacier2.Client.Trace.Request", "Glacier2.Filter.Address.Reject", "Glacier2.Filter.Address.Accept", - "Glacier2.Filter.ProxyLengthMax", + "Glacier2.Filter.ProxySizeMax", "Glacier2.Filter.Category.Accept", "Glacier2.Filter.AdapterId.Accept", "Glacier2.Filter.Identity.Accept", diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index e300fd8e56b..6e71547c19e 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `../config/PropertyNames.def', Fri Jun 30 14:22:37 2006 +// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Jul 5 13:10:25 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/test/Glacier2/addressFilter/run.py b/cpp/test/Glacier2/addressFilter/run.py index 6b32e4136c7..e62c35a5f6e 100755 --- a/cpp/test/Glacier2/addressFilter/run.py +++ b/cpp/test/Glacier2/addressFilter/run.py @@ -145,14 +145,6 @@ testcases = [ (False, '"a funny id/that might mess it up":tcp -h 127.0.0.1 -p 12010')], []), ] -if TestUtil.protocol == "ssl": - testcases.extend([ - ('testing maximum endpoints rule', - (r'', r'', r'1', '', '', ''), - [(True, 'hello:tcp -h %s -p 12010' % hostname), - (False, 'hello:tcp -h %s -p 12010:ssl -h %s -p 12011' % (hostname, hostname))], []), - ]) - if not limitedTests: testcases.extend([ ('testing reject all', @@ -185,6 +177,10 @@ if not limitedTests: ("127.0.0.1", fqdn, r'', '', '', ''), [(False, 'hello:tcp -h %s -p 12010:tcp -h 127.0.0.1 -p 12010' % fqdn), (True, 'bar:tcp -h 127.0.0.1 -p 12010')], []), + ('testing maximum proxy length rule', + (r'', r'', r'40', '', '', ''), + [(True, 'hello:tcp -h 127.0.0.1 -p 12010'), + (False, '012345678901234567890123456789012345678901234567890123456789:tcp -h 127.0.0.1 -p 12010')], []), ]) if len(testcases) == 0: @@ -275,7 +271,7 @@ for testcase in testcases: if not len(rejectFilter) == 0: routerConfig.write("Glacier2.Filter.Address.Reject=%s\n" % rejectFilter) if not len(maxEndpoints) == 0: - routerConfig.write("Glacier2.Filter.ProxyLengthMax=%s\n" % maxEndpoints) + routerConfig.write("Glacier2.Filter.ProxySizeMax=%s\n" % maxEndpoints) if not len(categoryFilter) == 0: routerConfig.write("Glacier2.Filter.Category.Accept=%s\n" % categoryFilter) if not len(idFilter) == 0: |