Skip to content

Commit 05e5f70

Browse files
committed
Fix unintended caching of password when not using builtin dialog
Resolves #310
1 parent 9e7f798 commit 05e5f70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

udiskie/prompt.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _cleanup(self):
5959

6060

6161
class PasswordResult:
62-
def __init__(self, password=None, cache_hint=None):
62+
def __init__(self, password=None, cache_hint=False):
6363
self.password = password
6464
self.cache_hint = cache_hint
6565

@@ -166,7 +166,8 @@ async def get_password_tty(device, options):
166166
# TODO: make this a TRUE async
167167
text = _('Enter password for {0.device_presentation}: ', device)
168168
try:
169-
return PasswordResult(getpass.getpass(text))
169+
return PasswordResult(getpass.getpass(text),
170+
options.get('cache_hint', False))
170171
except EOFError:
171172
print("")
172173
return None
@@ -223,7 +224,7 @@ async def __call__(self, device):
223224

224225
async def password(self, device, options):
225226
text = await self(device)
226-
return PasswordResult(text)
227+
return PasswordResult(text, options.get('cache_hint', False))
227228

228229

229230
def password(password_command):

0 commit comments

Comments
 (0)