From 584b0b6a36dc5944a078c2517233d43bb0ac5768 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Thu, 13 Jun 2024 03:35:01 +0200 Subject: [PATCH] Disable FTMP_FILE by default, drop login failure logging lastb is gone, so it is pointless to write to the btmp file. --- debian/login.defs | 6 --- debian/patches/008_login_log_failure_in_FTMP | 51 -------------------- debian/patches/series | 1 - 3 files changed, 58 deletions(-) delete mode 100644 debian/patches/008_login_log_failure_in_FTMP diff --git a/debian/login.defs b/debian/login.defs index 142e5b05..c13a860a 100644 --- a/debian/login.defs +++ b/debian/login.defs @@ -72,12 +72,6 @@ SYSLOG_SG_ENAB yes # #TTYTYPE_FILE /etc/ttytype -# -# If defined, login failures will be logged here in a utmp format -# last, when invoked as lastb, will read /var/log/btmp, so... -# -FTMP_FILE /var/log/btmp - # # If defined, the command name to display when running "su -". For # example, if this is defined as "su" then a "ps" will display the diff --git a/debian/patches/008_login_log_failure_in_FTMP b/debian/patches/008_login_log_failure_in_FTMP deleted file mode 100644 index 0946ca06..00000000 --- a/debian/patches/008_login_log_failure_in_FTMP +++ /dev/null @@ -1,51 +0,0 @@ -Goal: Log login failures to the btmp file - -Notes: - * I'm not sure login should add an entry in the FTMP file when PAM is used. - (but nothing in /etc/login.defs indicates that the failure is not logged) - ---- a/src/login.c -+++ b/src/login.c -@@ -827,6 +827,24 @@ - (void) puts (""); - (void) puts (_("Login incorrect")); - -+ if (getdef_str("FTMP_FILE") != NULL) { -+#ifdef USE_UTMPX -+ struct utmpx *failent = -+ prepare_utmpx (failent_user, -+ tty, -+ /* FIXME: or fromhost? */hostname, -+ utent); -+#else /* !USE_UTMPX */ -+ struct utmp *failent = -+ prepare_utmp (failent_user, -+ tty, -+ hostname, -+ utent); -+#endif /* !USE_UTMPX */ -+ failtmp (failent_user, failent); -+ free (failent); -+ } -+ - if (failcount >= retries) { - SYSLOG ((LOG_NOTICE, - "TOO MANY LOGIN TRIES (%u)%s FOR '%s'", ---- a/lib/getdef.c -+++ b/lib/getdef.c -@@ -38,7 +38,6 @@ - {"ENVIRON_FILE", NULL}, \ - {"ENV_TZ", NULL}, \ - {"FAILLOG_ENAB", NULL}, \ -- {"FTMP_FILE", NULL}, \ - {"HMAC_CRYPTO_ALGO", NULL}, \ - {"ISSUE_FILE", NULL}, \ - {"LASTLOG_ENAB", NULL}, \ -@@ -80,6 +79,7 @@ - {"ERASECHAR", NULL}, - {"FAIL_DELAY", NULL}, - {"FAKE_SHELL", NULL}, -+ {"FTMP_FILE", NULL}, - {"GID_MAX", NULL}, - {"GID_MIN", NULL}, - {"HOME_MODE", NULL}, diff --git a/debian/patches/series b/debian/patches/series index 503940b4..138c3bf0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,7 +2,6 @@ #900_testsuite_groupmems #901_testsuite_gcov -008_login_log_failure_in_FTMP 401_cppw_src.dpatch # 402 should be merged in 401, but should be reviewed by SE Linux experts first 402_cppw_selinux