mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-06 12:52:04 +00:00
fix: harden legacy/tui3 non-tty flows and shutdown stability
This commit is contained in:
1 parent
d3fc572c4e
commit
033870f2df
9 files changed
+112
-4
No files matched your search
@@ -142,6 +142,8 @@ def prompt_new_password(max_retries: int | None = None) -> str:
|
||||
print(colored("\nOperation cancelled by user.", "yellow"))
|
||||
logging.info("Password prompt interrupted by user.")
|
||||
raise PasswordPromptError("Operation cancelled by user")
|
||||
except EOFError:
|
||||
raise PasswordPromptError("Interactive password prompt requires a TTY")
|
||||
except Exception as e:
|
||||
logging.error(
|
||||
f"Unexpected error during password prompt: {e}", exc_info=True
|
||||
@@ -204,6 +206,8 @@ def prompt_existing_password(
|
||||
print(colored("\nOperation cancelled by user.", "yellow"))
|
||||
logging.info("Existing password prompt interrupted by user.")
|
||||
raise PasswordPromptError("Operation cancelled by user")
|
||||
except EOFError:
|
||||
raise PasswordPromptError("Interactive password prompt requires a TTY")
|
||||
except Exception as e:
|
||||
logging.error(
|
||||
f"Unexpected error during existing password prompt: {e}",
|
||||
|
||||
@@ -106,6 +106,8 @@ def _masked_input_posix(prompt: str) -> str:
|
||||
|
||||
def masked_input(prompt: str) -> str:
|
||||
"""Return input from the user while masking typed characters."""
|
||||
if not sys.stdin.isatty():
|
||||
raise EOFError("Interactive input requires a TTY")
|
||||
func = _masked_input_windows if sys.platform == "win32" else _masked_input_posix
|
||||
pause_console_logging()
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user