# HG changeset patch # User David Eckhardt # Date 2014-11-25 08:31:52 # Node ID c834c0194dbb3771a7e98e007cfa3b8e2e389efb # Parent d66547df82075ae320d62457ffd82b75d1cb0307 factotum: convert Plan 9 quoted string to Python string diff --git a/hgext/factotum.py b/hgext/factotum.py --- a/hgext/factotum.py +++ b/hgext/factotum.py @@ -72,9 +72,14 @@ def auth_getuserpasswd(self, getkey, par l = os.read(fd, ERRMAX).split() if l[0] == 'ok': os.write(fd, 'read') - l = os.read(fd, ERRMAX).split() - if l[0] == 'ok': - return l[1:] + status, user, passwd = os.read(fd, ERRMAX).split(None, 2) + if status == 'ok': + if passwd.startswith("'"): + if passwd.endswith("'"): + passwd = passwd[1:-1].replace("''", "'") + else: + raise util.Abort(_('malformed password string')) + return (user, passwd) except (OSError, IOError): raise util.Abort(_('factotum not responding')) finally: