Red Hat Bugzilla – Bug 216635
chage does not show the Account Expires if its shadow field is 0.
Last modified: 2018-10-19 16:21:30 EDT
Description of problem: Setting up in /etc/shadow : -- foo:pass:13454:0:99999:7::0: -- Will make chage not show the Account Expires field, as follows : -- Account Expires: Never -- My understanding is that Linux' based tools use -1 as the undefined value, however on other UNIX platforms, 0 was used. Checking on the source code there is still a bad condition that got fixed upstream and is also fixed on RHEL4. -- if (expdays <= 0) { -- Which should be < to allow just -1. The fact 0 is included on the test makes that date not shown, even if being that date a wrong setup, as by logic you would expect the system administrator to have date + Days setup. Otherwise the account gets blocked. However, if there is a legacy application ported from another UNIX, that uses shadow somehow and sets 0, then the account reset will be refused to access. Version-Release number of selected component (if applicable): shadow-utils-4.0.3-26.RHEL3 How reproducible: Always Steps to Reproduce: 1. Add a test user. 2. Edit manually /etc/shadow adding 0 in the sp_expire field. 3. chage the user. chage -l foo. Actual results: Account Expires: Never. Expected results: Account Expires: Jan 01, 1970. Additional info: Patch attached.
Created attachment 141745 [details] chage_account_expire
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2007-0431.html