Show More
@@ -67,21 +67,20 b' def auth_getuserpasswd(self, getkey, par' | |||
|
67 | 67 | while True: |
|
68 | 68 | fd = os.open('%s/rpc' % _mountpoint, os.O_RDWR) |
|
69 | 69 | try: |
|
70 | try: | |
|
71 | os.write(fd, 'start %s' % params) | |
|
72 | l = os.read(fd, ERRMAX).split() | |
|
73 |
|
|
|
74 | os.write(fd, 'read') | |
|
75 | status, user, passwd = os.read(fd, ERRMAX).split(None, 2) | |
|
76 |
if |
|
|
77 |
if passwd. |
|
|
78 |
|
|
|
79 | passwd = passwd[1:-1].replace("''", "'") | |
|
80 | else: | |
|
81 | raise util.Abort(_('malformed password string')) | |
|
82 | return (user, passwd) | |
|
83 | except (OSError, IOError): | |
|
84 | raise util.Abort(_('factotum not responding')) | |
|
70 | os.write(fd, 'start %s' % params) | |
|
71 | l = os.read(fd, ERRMAX).split() | |
|
72 | if l[0] == 'ok': | |
|
73 | os.write(fd, 'read') | |
|
74 | status, user, passwd = os.read(fd, ERRMAX).split(None, 2) | |
|
75 | if status == 'ok': | |
|
76 | if passwd.startswith("'"): | |
|
77 | if passwd.endswith("'"): | |
|
78 | passwd = passwd[1:-1].replace("''", "'") | |
|
79 | else: | |
|
80 | raise util.Abort(_('malformed password string')) | |
|
81 | return (user, passwd) | |
|
82 | except (OSError, IOError): | |
|
83 | raise util.Abort(_('factotum not responding')) | |
|
85 | 84 | finally: |
|
86 | 85 | os.close(fd) |
|
87 | 86 | getkey(self, params) |
General Comments 0
You need to be logged in to leave comments.
Login now