From 6e11fe27286d9202280771ad1a402657e67ee065 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 30 Sep 2023 16:11:57 +0800 Subject: [PATCH 1/2] createfiles: Add Y2038 info about the traditional {b,u,w}tmp and lastlog files And utmp does not exist on systemd-based LFS. --- chapter07/createfiles.xml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/chapter07/createfiles.xml b/chapter07/createfiles.xml index 2b752b944..ec4b0eee2 100644 --- a/chapter07/createfiles.xml +++ b/chapter07/createfiles.xml @@ -215,8 +215,23 @@ chmod -v 600 /var/log/btmp failed login attempts. The /var/log/btmp file records the bad login attempts. - The /run/utmp file records the users that - are currently logged in. This file is created dynamically in the boot - scripts. + + The /run/utmp file + records the users that are currently logged in. This file is created + dynamically in the boot scripts. + + + + + The utmp, + wtmp, btmp, and + lastlog files use 32-bit integers for timestamp + and they'll be fundamentally broken after year 2038. Many packages + have stopped using them and other packages are going to stop using + them. Do not rely on the contents of them for anything. + + From c7cd2c71e7f96bcc42f91399098f083beb757788 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 30 Sep 2023 16:14:17 +0800 Subject: [PATCH 2/2] shadow: Remove lastlog from contents It's deprecated because of Y2038 issue and no longer being built by default. --- chapter08/shadow.xml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml index f88216a5b..315234c7f 100644 --- a/chapter08/shadow.xml +++ b/chapter08/shadow.xml @@ -276,7 +276,7 @@ useradd -D --gid 999 chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, getsubids, gpasswd, groupadd, groupdel, groupmems, groupmod, grpck, - grpconv, grpunconv, lastlog, login, logoutd, newgidmap, newgrp, + grpconv, grpunconv, login, logoutd, newgidmap, newgrp, newuidmap, newusers, nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod, vigr (link to vipw), and vipw @@ -459,17 +459,6 @@ useradd -D --gid 999 - - lastlog - - Reports the most recent login of all users or of a - given user - - lastlog - - - - login