From 5daa74d1afbdf5b54cc1600619d706b6fcc16ff6 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Thu, 30 Nov 2006 19:34:25 -0700
Subject: [PATCH] change manhole setup for client: create authorized_keys.8022
 (or other portnum)

---
 allmydata/client.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/allmydata/client.py b/allmydata/client.py
index 78f7381b..909c55c2 100644
--- a/allmydata/client.py
+++ b/allmydata/client.py
@@ -15,7 +15,6 @@ class Storage(service.MultiService, Referenceable):
 
 class Client(service.MultiService, Referenceable):
     CERTFILE = "client.pem"
-    AUTHKEYSFILE = "authorized_keys"
 
     def __init__(self, queen_pburl):
         service.MultiService.__init__(self)
@@ -35,11 +34,14 @@ class Client(service.MultiService, Referenceable):
         s = Storage()
         s.setServiceParent(self)
 
-        if os.path.exists(self.AUTHKEYSFILE):
-            from allmydata import manhole
-            m = manhole.AuthorizedKeysManhole(8022, self.AUTHKEYSFILE)
-            m.setServiceParent(self)
-            log.msg("AuthorizedKeysManhole listening on 8022")
+        AUTHKEYSFILEBASE = "authorized_keys."
+        for f in os.listdir("."):
+            if f.startswith(AUTHKEYSFILEBASE):
+                portnum = int(f[len(AUTHKEYSFILEBASE):])
+                from allmydata import manhole
+                m = manhole.AuthorizedKeysManhole(portnum, f)
+                m.setServiceParent(self)
+                log.msg("AuthorizedKeysManhole listening on %d" % portnum)
 
     def _setup_tub(self, local_ip):
         portnum = 0
-- 
2.45.2