Add UserPasswordExpired for local users
Adds a new UserPasswordExpired property to local User.Attributes which
represents if the account's password is expired and must be changed.
The value corresponds to the `chage` command.
Note this is distinct from UserLockedForFailedAttempt which represents
a locked account due to unsuccessful authentication atttempts.
Tested: Via busctl
- Checked local and LDAP users.
- Expired password via `passwd --expire USER`.
- Aged password via `chage USER`.
- Changed password via REST API and via the `passwd USER` command.
Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net>
Change-Id: I44585559509a422bb91c83a2a853c1a033594350
diff --git a/user_mgr.hpp b/user_mgr.hpp
index c008cea..e25ca87 100644
--- a/user_mgr.hpp
+++ b/user_mgr.hpp
@@ -168,6 +168,13 @@
bool userLockedForFailedAttempt(const std::string &userName,
const bool &value);
+ /** @brief shows if the user's password is expired
+ *
+ * @param[in]: user name
+ * @return - true / false indicating user password expired
+ **/
+ virtual bool userPasswordExpired(const std::string &userName);
+
/** @brief returns user info
* Checks if user is local user, then returns map of properties of user.
* like user privilege, list of user groups, user enabled state and user