node.py: chmod the foolscap private key (node.pem) to 0600, since it's secret

This commit is contained in:
Brian Warner 2007-09-21 16:52:55 -07:00
parent 594a104c71
commit 325c7a7bfa
1 changed files with 1 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class Node(service.MultiService):
self._tub_ready_observerlist = observer.OneShotObserverList() self._tub_ready_observerlist = observer.OneShotObserverList()
certfile = os.path.join(self.basedir, self.CERTFILE) certfile = os.path.join(self.basedir, self.CERTFILE)
self.tub = Tub(certFile=certfile) self.tub = Tub(certFile=certfile)
os.chmod(certfile, 0600)
self.tub.setOption("logLocalFailures", True) self.tub.setOption("logLocalFailures", True)
self.tub.setOption("logRemoteFailures", True) self.tub.setOption("logRemoteFailures", True)
self.nodeid = b32decode(self.tub.tubID.upper()) # binary format self.nodeid = b32decode(self.tub.tubID.upper()) # binary format