pam/pam-bsc1194818-cursor-escape.patch
Thorsten Kukuk 8f4235636c - Update to version 1.7.0
- build: changed build system from autotools to meson.
  - libpam_misc: use ECHOCTL in the terminal input
  - pam_access: support UID and GID in access.conf
  - pam_env: install environment file in vendordir if vendordir is enabled
  - pam_issue: only count class user if logind support is enabled
  - pam_limits: use systemd-logind instead of utmp if logind support is enabled
  - pam_unix: compare password hashes in constant time
  - Multiple minor bug fixes, build fixes, portability fixes,
    documentation improvements, and translation updates.
- Drop upstream patches:
  - pam-bsc1194818-cursor-escape.patch
  - pam_limits-systemd.patch
  - pam_issue-systemd.patch

OBS-URL: https://build.opensuse.org/package/show/Linux-PAM/pam?expand=0&rev=302
2024-10-24 12:22:19 +00:00

37 lines
1.1 KiB
Diff

From 8ae228fa76ff9ef1d8d6b2199582d9206f1830c6 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.cz>
Date: Mon, 22 Jul 2024 23:18:16 +0200
Subject: [PATCH] libpam_misc: Use ECHOCTL in the terminal input
Use the canonical terminal mode (line mode) and set ECHOCTL to prevent
cursor escape from the login prompt using arrows or escape sequences.
ICANON is the default in most cases anyway. ECHOCTL is default on tty, but
for example not on pty, allowing cursor to escape.
Stanislav Brabec <sbrabec@suse.com>
---
libpam_misc/misc_conv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c
index 7410e929..6b839b48 100644
--- a/libpam_misc/misc_conv.c
+++ b/libpam_misc/misc_conv.c
@@ -145,9 +145,10 @@ static int read_string(int echo, const char *prompt, char **retstr)
return -1;
}
memcpy(&term_tmp, &term_before, sizeof(term_tmp));
- if (!echo) {
+ if (echo)
+ term_tmp.c_lflag |= ICANON | ECHOCTL;
+ else
term_tmp.c_lflag &= ~(ECHO);
- }
have_term = 1;
/*
--
2.45.2