diff options
author | Rob Austein <sra@hactrn.net> | 2010-03-12 22:34:27 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-03-12 22:34:27 +0000 |
commit | 2334c030842a07fc350493d495237ce57380b132 (patch) | |
tree | 2424645822ab60a674fa7d5e3002c053433522fb /rpkid | |
parent | b6f0d52bc2e5bd8527158e29c8ebc3a952b08222 (diff) |
Clean up multi-module kludge. This should go away entirely once I
have everybody migrated to the new setup tools.
svn path=/rpkid/pubd.py; revision=3078
Diffstat (limited to 'rpkid')
-rw-r--r-- | rpkid/pubd.py | 5 | ||||
-rw-r--r-- | rpkid/rpki/publication.py | 12 |
2 files changed, 7 insertions, 10 deletions
diff --git a/rpkid/pubd.py b/rpkid/pubd.py index 8d58b002..5e5391af 100644 --- a/rpkid/pubd.py +++ b/rpkid/pubd.py @@ -62,10 +62,7 @@ class pubd_context(object): self.publication_base = cfg.get("publication-base", "publication/") - if cfg.has_option("publication-multimodule"): - self.publication_multimodule = cfg.getboolean("publication-multimodule") - else: - self.publication_multimodule = cfg.get("publication-module", "-") == "" + self.publication_multimodule = cfg.getboolean("publication-multimodule", False) def handler_common(self, query, client, cb, certs, crl = None): """ diff --git a/rpkid/rpki/publication.py b/rpkid/rpki/publication.py index 04095c26..0cac5d95 100644 --- a/rpkid/rpki/publication.py +++ b/rpkid/rpki/publication.py @@ -253,12 +253,12 @@ class publication_object_elt(rpki.xml_utils.base_elt, publication_namespace): """ if not self.uri.startswith("rsync://"): raise rpki.exceptions.BadURISyntax, self.uri - u = 0 - n = 3 if self.gctx.publication_multimodule else 4 - for i in xrange(n): - u = self.uri.index("/", u + 1) - filename = self.gctx.publication_base.rstrip("/") + self.uri[u:] - if "//" in filename or "/../" in filename or filename.endswith("/.."): + path = self.uri.split("/")[3:] + if not self.gctx.publication_multimodule: + del path[0] + path.insert(0, self.gctx.publication_base.rstrip("/")) + filename = "/".join(path) + if "/../" in filename or filename.endswith("/.."): raise rpki.exceptions.BadURISyntax, filename return filename |