[packages/pam] keep on using PAM_TTY without /dev/ prefix in unmaintained pam_console module; rel 2

atler atler at pld-linux.org
Wed Feb 17 13:34:56 CET 2021


commit 708216722213e1eb55d078b10e0ba8590ab77ec4
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Feb 17 13:31:27 2021 +0100

    keep on using PAM_TTY without /dev/ prefix in unmaintained pam_console module; rel 2
    
    login changed it in 2.36.2:
    https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?h=stable/v2.36&id=f40291fff8fe35ea3b8632e6a24ca17d760e1187

 pam.spec                  |  4 +++-
 pam_console_pam_tty.patch | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
---
diff --git a/pam.spec b/pam.spec
index 3957ae9..1107982 100644
--- a/pam.spec
+++ b/pam.spec
@@ -24,7 +24,7 @@ Summary(tr.UTF-8):	Modüler, artımsal doğrulama birimleri
 Summary(uk.UTF-8):	Інструмент, що забезпечує аутентифікацію для програм
 Name:		pam
 Version:	1.4.0
-Release:	1
+Release:	2
 Epoch:		1
 # The library is BSD licensed with option to relicense as GPLv2+
 # - this option is redundant as the BSD license allows that anyway.
@@ -50,6 +50,7 @@ Patch3:		%{name}-mkhomedir-notfound.patch
 Patch4:		%{name}-db-gdbm.patch
 Patch5:		%{name}-exec-failok.patch
 Patch6:		update-motd.patch
+Patch7:		pam_console_pam_tty.patch
 URL:		http://www.linux-pam.org/
 %{?with_audit:BuildRequires:	audit-libs-devel >= 1.6.9}
 BuildRequires:	autoconf >= 2.61
@@ -282,6 +283,7 @@ danych GDBM.
 # upstream has similar approach for multiple files (not no exec):
 # https://github.com/linux-pam/linux-pam/pull/48
 #%patch6 -p1
+%patch7 -p1
 
 %build
 %{__libtoolize}
diff --git a/pam_console_pam_tty.patch b/pam_console_pam_tty.patch
new file mode 100644
index 0000000..f173398
--- /dev/null
+++ b/pam_console_pam_tty.patch
@@ -0,0 +1,22 @@
+--- Linux-PAM-1.4.0/modules/pam_console/pam_console.c.orig	2008-12-16 13:37:52.000000000 +0100
++++ Linux-PAM-1.4.0/modules/pam_console/pam_console.c	2021-02-17 13:14:35.484487701 +0100
+@@ -521,6 +521,9 @@
+         _pam_log(pamh, LOG_ERR, TRUE, "TTY not defined");
+ 	return PAM_SESSION_ERR;
+     }
++    if (!strncmp("/dev/", tty, 5)) {
++        tty = tty + 5;
++    }
+ 
+     /* get configuration */
+     if (!configfileparsed) { 
+@@ -584,6 +587,9 @@
+     if (is_root(pamh, username)) return PAM_SUCCESS;
+     pam_get_item(pamh, PAM_TTY, CAST_ME_HARDER &tty);
+     if (!tty || !tty[0]) return PAM_SESSION_ERR;
++    if (!strncmp("/dev/", tty, 5)) {
++        tty = tty + 5;
++    }
+ 
+     /* get configuration */
+     if (!configfileparsed) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pam.git/commitdiff/708216722213e1eb55d078b10e0ba8590ab77ec4



More information about the pld-cvs-commit mailing list