-
Bug
-
Resolution: Done-Errata
-
Normal
-
rhel-8.7.0
-
util-linux-2.32.1-46.el8
-
None
-
Low
-
rhel-sst-cs-plumbers
-
ssg_core_services
-
26
-
2
-
False
-
-
None
-
None
-
Pass
-
Automated
-
If docs needed, set a value
-
-
All
-
None
Description of problem:
Issue 1. Incorrect description.
According to shadow specification, the 8th field is Account Expiration. It is mistakenly labeled as Password Expiration by lslogins.
struct spwd
{ char *sp_namp; /* user login name */ char *sp_pwdp; /* encrypted password */ long int sp_lstchg; /* last password change */ long int sp_min; /* days until change allowed. */ long int sp_max; /* days before change required */ long int sp_warn; /* days warning for expiration */ long int sp_inact; /* days before account inactive */ long int sp_expire; /* date when account expires */ unsigned long int sp_flag; /* reserved for future use */ }- useradd jane
- grep jane /etc/shadow
jane:!!:19494:0:99999:7:::
- lslogins jane
Username: jane
UID: 1003
Gecos field:
Home directory: /home/jane
Shell: /bin/bash
No login: no
Password is locked: yes
Password not required (empty): yes
Login by password disabled: no
Primary group: jane
GID: 1003
Hushed: no
Password expiration warn interval: 7
Password changed: 10:00
Maximum change time: 99999
Running processes: 0
- usermod -e "2020-12-31" jane
- grep jane /etc/shadow
jane:!!:19494:0:99999:7::18627:
- lslogins jane
Username: jane
UID: 1003
Gecos field:
Home directory: /home/jane
Shell: /bin/bash
No login: no
Password is locked: yes
Password not required (empty): yes
Login by password disabled: no
Primary group: jane
GID: 1003
Hushed: no
Password expiration warn interval: 7
Password changed: 10:00
Maximum change time: 99999
Password expiration: 2020-Dec31 <<<<<=====
Running processes: 0
2. Date format consistency
If expiration is set to 31 Dec of past year, the output is shown as "Dec31/10:00", i.e.:
- date
Wed May 17 10:25:14 AEST 2023 <<<<< Today is May 2023
- usermod -e "2022-12-31" jane <<<<< Dec last year
- lslogins jane
Password expiration: Dec31/10:00 <<<<< year is omitted
If year is omitted, users will be mistaken to think it is same year as today, i.e. 2023-Dec-31
In contrast, if account expiration is set to 2023-12-31, the full date is printed:
- usermod -e "2023-12-31" jane
Password expiration: 2023-Dec31 <<<<< year is printed
Suggestion:
1. Same output format regardless the expiration year relative to current year, or
2. Omit the year if expiration date is the same as current year.
Version-Release number of selected component (if applicable):
util-linux-2.32.1-39.el8_7.x86_64