-
Notifications
You must be signed in to change notification settings - Fork 12
Description
This issue is to enhance phosphor-user-manager to signal PropertiesChanged when a local user account's password becomes expired (for example, because the password expires due to time passing) or becomes unexpired (for example, because the password is successfully changed). Note that both of these causes are outside the operation of phosphor-user-manager.
These transitions are not currently detected by phosphor-user-manager or any part of Linux. For background, see the shadow file, field 3 (days since epoch of last password change) and field 5 (days before change required). Note also that Linux-PAM also updates the shadow file, for example, as part of a BMCWeb POST /redfish/v1/AccountService/Accounts/USER --data {"Password': "NEWPASSWORD"}.
Here are two ideas (which need to both be implemented) to implement this:
- Watch (via inotify) the shadow file for changes and respond to changes: re-read the shadow file, update properties, and send appropriate PropertiesChanged signals.
- Predict when the next local user account password will expire (see user_mgr.cpp / userPasswordExpired()) and a set a timer to wake up and check. The handler would re-read the shadow file, update properties, and send appropriate PropertiesChanged signals, and reset the timer.
This would add complexity. Is there a more standard way to accomplish this?
This issue was created in response to a BMCWeb review which relies on the PropertiesChanged signal.