summaryrefslogtreecommitdiff
path: root/sys/lib/python
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-08-08 05:35:06 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-08-08 05:35:06 +0200
commit15fd8261474dfa71437fc4e50beb0ea022dd1b1b (patch)
tree72dc89b841d881798e6316344ea2f047558a6ea4 /sys/lib/python
parentc8d1a885f84cb26035c0f2d6827e74d1338c7a16 (diff)
hgwebfs: make hgwebfs prompt for password
Diffstat (limited to 'sys/lib/python')
-rw-r--r--sys/lib/python/hgext/hgwebfs.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/lib/python/hgext/hgwebfs.py b/sys/lib/python/hgext/hgwebfs.py
index d4b46acb5..70db3bc56 100644
--- a/sys/lib/python/hgext/hgwebfs.py
+++ b/sys/lib/python/hgext/hgwebfs.py
@@ -2,9 +2,26 @@
import mercurial.url
import re
+import os
class Webconn:
def __init__(self, mnt, req):
+ try:
+ self.open(mnt, req)
+ except IOError, e:
+ try:
+ errstr = e.strerror
+ params = errstr[errstr.index("needkey ")+8:]
+ if params.find("!password?") < 0:
+ raise e
+ if os.spawnl(os.P_WAIT, "/boot/factotum", "getkey", "-g", params) != 0:
+ raise e
+ self.open(mnt, req)
+ return
+ except:
+ raise e
+
+ def open(self, mnt, req):
if type(req) == str:
self.url = req
else: