Fix permissions of authorized_keys file for sshd StrictModes
authorSteven King <kingrst@gmail.com>
Tue, 30 Nov 2010 11:26:08 -0500
changeset 260 57dcdb212d00
parent 253 f0630151e057
child 262 675474f5be32
Fix permissions of authorized_keys file for sshd StrictModes
src/mercurialserver/refreshauth.py
--- a/src/mercurialserver/refreshauth.py	Wed Jan 27 17:02:43 2010 +0000
+++ b/src/mercurialserver/refreshauth.py	Tue Nov 30 11:26:08 2010 -0500
@@ -4,7 +4,7 @@
 
 import re
 import base64
-import os
+import os, stat
 import os.path
 import subprocess
 from mercurialserver import config
@@ -55,6 +55,7 @@
                     if len(l):
                         akeys.write('%s"%s %s" %s\n' % (prefix, wrappercommand, keyname, l))
     akeys.close()
+    os.chmod(akeyfile + "_new", stat.S_IRUSR)
     os.rename(akeyfile + "_new", akeyfile)
     
 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):