History log of /openbmc/phosphor-user-manager/ (Results 1 – 25 of 217)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
2a137f4d05-Aug-2025 Ivan Mikhaylov <fr0st61te@gmail.com>

Add CreateUser2 method to create a new local user

This method is identical to the existing CreateUser method with only
addition which allows to specify Epoch time when a password of the user
being c

Add CreateUser2 method to create a new local user

This method is identical to the existing CreateUser method with only
addition which allows to specify Epoch time when a password of the user
being created expires. The idea to introduce new method creating a user
alongside with a password expiration was suggested in a comment [1] in
the corresponding review in bmcweb [2].

To make password not to expire, uint64_t maximum should be provided as
a password expiration argument value.

Not to set password expiration, zero should be provided as a password
expiration argument. This value is required to create a user without
password expiration specified, to unify calls from the bmcweb. Moreover,
this value is required to further extend CreateUser2 method to allow
create a user with password and account expiration but to use it in a
situation, for example, when account expiration is specified but
password expiration is not.

Local user password management was implemented to reflect changes in the
corresponding PasswordExpiration attribute in the
xyz.openbmc_project.User.Attributes interface.

Functionality is implemented via calls to 'chage' utility. It is worth
to mention, that 'chage' utility operates on the password last change
date and password age in days, hence date time password expiration date
time is rounded to fit into integer number of days. Also, because of
'chage' specifics it is not possible to set password expiration to a
timepoint which happened before the last password change date, because
this makes password not to expire.

GetUserInfo implementation was changed accordingly to report user
password expiration.

Unit tests were implemented as well.

This change depends on the corresponding change in
phosphos-dbus-interfaces [3].

Tested:
1. created user 'user1' via a call to CreateUser2 with password
expiration value set to zero, verified that correct value is set in
PasswordExpiration attribute on D-Bus, verified via 'chage' utility
that user's password expiration is left intact
2. created user 'user2' via a call to CreateUser2 with password
expiration value set to maximum, verified that correct value is set
in PasswordExpiration attribute on D-Bus, verified via 'chage'
utility that password does not expire
3. created user 'user2' via a call to CreateUser2 without password
expiration value, verified that default value is set
in PasswordExpiration attribute on D-Bus, verified via 'chage'
utility that password does not expire
4. created user 'user3' via a call to CreateUser2 with password
expiration value set to make password expire in 5 days, verified that
correct value is set in PasswordExpiration attribute on D-Bus,
verified via 'chage' utility that password expiration date is correct
5. created user 'user4' via a call to CreateUser2 with password
expiration value set to zero,
5.1 changed PasswordExpiration attribute to maximum value via `busctl`
call, verified that the attribute is correct on D-Bus, verified via
'chage' that user's password does not expire
5.2 changed PasswordExpiration attribute to a value to make password
expiration happen in 5 days, verified that the attribute is correct
on D-Bus, verified via 'chage' utility that password expires in 5
days,
5.3 renamed the user to 'user5' via RenameUser call, verified that
'user5' had the same value of PasswordExpirtion attribute as 'user4'
had had
6. tried to create a new user with invalid password expiration value set
to a time point in the past, got appropriate error
7. tried to set PasswordExpiration attribute to a time point which
happened before the last password change, got appropriate error

[1] ```https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75372/comment/d35c832d_e769bf9c/```
[2] ```https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75372```
[3] ```https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/75236```

Change-Id: Iccfb0c91c3b5ec353c59cc4f3abe66e5d9817b5a
Signed-off-by: Ivan Moiseev <moiseev.ivan4w@yandex.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>

show more ...

2e66146604-Nov-2025 Patrick Williams <patrick@stwcx.xyz>

remove is_method_error call

An `is_method_error` is not appropriate after an sdbus `call` since
`call` will always throw an exception. Remove the pointless call
and instead catch the exception.

Si

remove is_method_error call

An `is_method_error` is not appropriate after an sdbus `call` since
`call` will always throw an exception. Remove the pointless call
and instead catch the exception.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib82c90e78508b5e996ced1d29091dd609f1fba07

show more ...

395711d102-Nov-2025 Ravi Teja <raviteja28031990@gmail.com>

Remove default LDAP privilege role

Currently when there is no privilege role map matching to the ldap user,
ldap user gets priv-user(read-only) privilege for redfish sessions which
is considered as

Remove default LDAP privilege role

Currently when there is no privilege role map matching to the ldap user,
ldap user gets priv-user(read-only) privilege for redfish sessions which
is considered as security concern since by default all ldap users able
to login to BMC GUI and redfish sessions.

This commit removes default priv-user(read-only) privilege for LDAP
users when there is no matching privilege role.

Tested By:
Redfish session creation fails for ldap users when there is no matching
privilege role map

Change-Id: I5247ce53577ecdf27f41bc4e2a3d1947d093874b
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>

show more ...

73b8ab4325-Aug-2025 George Liu <liuxiwei@ieisystem.com>

Remove Boost dependency

phosphor-user-manager no longer uses any Boost functionality, so
remove Boost from meson.build and all related includes.

Change-Id: I7432e65c2b91e35892bc587e88dd9bb861843775

Remove Boost dependency

phosphor-user-manager no longer uses any Boost functionality, so
remove Boost from meson.build and all related includes.

Change-Id: I7432e65c2b91e35892bc587e88dd9bb861843775
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...

0615260c25-Aug-2025 George Liu <liuxiwei@ieisystem.com>

Replace boost ends_with with std::string

C++20 introduces std::string::ends_with, which provide standard,
efficient, and header-light ways to check string prefixes and
suffixes. Replacing boost::alg

Replace boost ends_with with std::string

C++20 introduces std::string::ends_with, which provide standard,
efficient, and header-light ways to check string prefixes and
suffixes. Replacing boost::algorithm::ends_with reduces Boost
dependencies, simplifies includes, and improves compilation
performance.

Change-Id: I4dbb849a750f55e3fe7409ba91c63d8a379aae18
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...

3ddb95af13-Jun-2025 Abhilash Raju <abhilash.kollam@gmail.com>

MFA: Changing ownership of conf dir

The .conf directory created during secret key generation requires a
change in ownership to allow Google Authenticator to read and write.
TOTP verification will fa

MFA: Changing ownership of conf dir

The .conf directory created during secret key generation requires a
change in ownership to allow Google Authenticator to read and write.
TOTP verification will fail if the correct permissions are not set.

Tested By:
- curl /redfish/v1/AccountService/Accounts/
<str>/Actions/ManagerAccount.GenerateSecretKey
- curl /redfish/v1/AccountService/Accounts/
<str>/Actions/ManagerAccount.VerifyTimeBasedOneTimePassword

Result:
TOTP was successfully verified.

Change-Id: I1a13800894a0a11c7236748fea94db6e466987ee
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>

show more ...

f219665902-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

json_serializer: handled corrupted files

When the `/var/lib/usr_mgr.conf` file is either empty or corrupted
JSON, the daemon will crash and not recover. Handle this by catching
JSON load exceptions

json_serializer: handled corrupted files

When the `/var/lib/usr_mgr.conf` file is either empty or corrupted
JSON, the daemon will crash and not recover. Handle this by catching
JSON load exceptions and deleting the corrupted file.

Fixes openbmc/phosphor-user-manager#19.

Tested: Added additional test cases to cover the corruption case and
update the test case to cover the non-throwing behavior.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2be787771ea3d72af924615a6eee17cf2f393e9a

show more ...

ca3729ae09-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

meson: use non-deprecated systemd packageconfig

Systemd's packageconfig file has both `systemdsystemunitdir` and
`systemd_system_unit_dir` defined. The non-underscore one appears
to be a deprecated

meson: use non-deprecated systemd packageconfig

Systemd's packageconfig file has both `systemdsystemunitdir` and
`systemd_system_unit_dir` defined. The non-underscore one appears
to be a deprecated alias[1]. Move to the non-deprecated /
underscore-separated variant.

[1]: https://github.com/systemd/systemd/commit/4908de44b0a0409f84a7cdc5641b114d6ce8ba03

Change-Id: I5b5c4ab5a22c5263018357eed81482638d133cc2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

0af827c502-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

test: user_mgr: convert mktemp to mkstemp

`mktemp` is consider deprecated and should no longer be used. Switch
the test case calls to use `mkstemp` instead.

Signed-off-by: Patrick Williams <patric

test: user_mgr: convert mktemp to mkstemp

`mktemp` is consider deprecated and should no longer be used. Switch
the test case calls to use `mkstemp` instead.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia9318eff88e403422fc8d40fb6b09b60cd226c76

show more ...

5cf5ddf302-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

json_serializer: add tests

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I717b01ac4f69b9b086a4853cb28bb4c27d1f784b

0b5f158509-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

meson: add option to disable LDAP

Add a meson option that can be used to disable LDAP support. This will
allow the Yocto recipe to reduce the libraries pulled in for configs
that do not use LDAP.

meson: add option to disable LDAP

Add a meson option that can be used to disable LDAP support. This will
allow the Yocto recipe to reduce the libraries pulled in for configs
that do not use LDAP.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ida0b7f7062dd4672812eb25825d4c4bebd571901

show more ...

2071264802-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

meson: add dependency for nlohmann-json

nlohmann-json is not always installed, especially when developers are
attempting to do out-of-Docker builds. Meson subprojects are the
method we use to handl

meson: add dependency for nlohmann-json

nlohmann-json is not always installed, especially when developers are
attempting to do out-of-Docker builds. Meson subprojects are the
method we use to handle this case. Add the meson subproject wrap and
appropriate dependency values in the meson.build files.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id855f8e320d9ab9332a3803f6ab0dff3aebfd39b

show more ...

2746e0c025-Jun-2025 Patrick Williams <patrick@stwcx.xyz>

user-mgr: convert boost::process::child to fork/execv

Boost process v1 is deprecated and removed in the next version
of Boost. process v2 is async-only and cannot easily be replaced
with the curren

user-mgr: convert boost::process::child to fork/execv

Boost process v1 is deprecated and removed in the next version
of Boost. process v2 is async-only and cannot easily be replaced
with the current usages. Switch to use raw fork/execv calls instead,
which is what boost would have done internally.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia802cc5428b37dbe428bf1f8befcac168ff3262b

show more ...

16f0efa125-Jun-2025 Patrick Williams <patrick@stwcx.xyz>

user-mgr: add unit test for executeCmd

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I0a7110c12504b547192e186db334e4b62eaaea4e

a335311f25-Jun-2025 Patrick Williams <patrick@stwcx.xyz>

meson: handle missing ldap dependency

Adjust the meson.build so that ldap can be an optional dependency.
This allows out-of-docker builds for environments which might not have
the LDAP libraries ins

meson: handle missing ldap dependency

Adjust the meson.build so that ldap can be an optional dependency.
This allows out-of-docker builds for environments which might not have
the LDAP libraries installed. In the future this could also be
leveraged by a meson.option that would disable LDAP support.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I214b7e69580bd11432f88a85fa760a5e07f7fad2

show more ...

9ca8692d18-May-2025 Chandramohan Harkude <chandramohan.harkude@gmail.com>

Add support for MAX PASSWORD LENGTH

As per NIST Guideline https://pages.nist.gov/800-63-4/sp800-63b.html

Verifiers and CSPs SHOULD permit a MaxPasswordLength must be at least
64 characters therefo

Add support for MAX PASSWORD LENGTH

As per NIST Guideline https://pages.nist.gov/800-63-4/sp800-63b.html

Verifiers and CSPs SHOULD permit a MaxPasswordLength must be at least
64 characters therefore added this support. Added this as a meson option
each organization can configure their own MAX PASSWORD LENGTH. Default
value is as per NIST guideline recommendation

Testing:

Validated MinPasswordLangth > MaxPasswordLength test cases and worked
as expected.

Change-Id: I75b0056a0acc038d3103016ebbdaa6be08df74a1
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>

show more ...

8a85ace012-Jun-2025 Chandramohan Harkude <chandramohan.harkude@gmail.com>

Fix CI build issues

MRs created for phosphor-user-manager are failing with below error

```
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any to

Fix CI build issues

MRs created for phosphor-user-manager are failing with below error

```
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
in "<unicode string>", line 21, column 62:
... fier-naming.ClassCase, value: CamelCase }
^
clang_tidy - FAILED

```
To fix this modified the .clang-tidy file as suggested by CI

Change-Id: Ic48e49d3add01e0cd725a9e7b22abb11764fa275
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>

show more ...

8ad64b0318-May-2025 Chandramohan Harkude <chandramohan.harkude@gmail.com>

Fix Clang 20 build issues

It is observed that with recent change of clang to 20 there are some CI
build issues found on phosphor-user-manager based on readability and
style. I fixed the same

Change

Fix Clang 20 build issues

It is observed that with recent change of clang to 20 there are some CI
build issues found on phosphor-user-manager based on readability and
style. I fixed the same

Change-Id: Ief2a902b9970c628b26e908b8c784efe9e524bf6
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>

show more ...

c4183b8425-Dec-2024 Ivan Moiseev <moiseev.ivan4w@yandex.com>

user_mgr: Fix user enabled state check

Detect user enabled state by checking user account expiration date
against current date.
Until this change user enabled state was detecting by checking user
ac

user_mgr: Fix user enabled state check

Detect user enabled state by checking user account expiration date
against current date.
Until this change user enabled state was detecting by checking user
account expiration date against 0 value. This check is incorrect
because it is false positive in case when account expiration date is in
the future but such user is reported as disabled.

Steps to reproduce the issue:
1. create some user on the system
2. set account expiration date for this user to happen in the future via
'chage' or 'usermod' utilities (I set account expiration date to
01-01-2100
3. check ```UserEnabled``` attribute for this user on D-Bus[1], it is
false, though user is actually enabled
4. check ```Enabled``` attribute for this user in response to REST API
request getting this user information [2], it is false

Tested:
1. create user1 on the system, set its account expiration date to the
past (I set it to 01-01-2000), verify that user ```UserEnabled```
attribute is false on D-Bus and ```Enabled``` is false in REST API
response
2. create user2 in the system, set its account expiration date to the
future (I set it to 01-01-2100), verify that user ```UserEnabled```
attribute is true on D-Bus and ```Enabled``` is true in REST API
response
3. create user3 in the system, verify that it is enabled

[1] ```
busctl get-property xyz.openbmc_project.User.Manager \
/xyz/openbmc_project/user/user1 xyz.openbmc_project.User.Attributes \
UserEnabled
```
[2] ```
curl -k -X GET https://<bmc>/redfish/v1/AccountService/Accounts/user1
```

Change-Id: Ie3dc735bc106bcd747f64cbaf94eace12e09847f
Signed-off-by: Ivan Moiseev <moiseev.ivan4w@yandex.com>

show more ...

4a26320e04-Apr-2025 Ravi Teja <raviteja28031990@gmail.com>

Revert "Unit Test: Adding unit test cases UsrMgr"

This reverts commit 0e427be810a3233f23186cce599e8bf680ae3f62.

Change-Id: I01478d33b2d9d413fab5d7e548e7312de4f07f6b
Signed-off-by: Ravi Teja <ravite

Revert "Unit Test: Adding unit test cases UsrMgr"

This reverts commit 0e427be810a3233f23186cce599e8bf680ae3f62.

Change-Id: I01478d33b2d9d413fab5d7e548e7312de4f07f6b
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>

show more ...

0e427be803-Mar-2025 Abhilash Raju <abhilash.kollam@gmail.com>

Unit Test: Adding unit test cases UsrMgr

This changes set will add needed unit test cases for User Manager

Change-Id: I848cdbde528d41c2a09abcf35527044b6084f023
Signed-off-by: Abhilash Raju <abhilas

Unit Test: Adding unit test cases UsrMgr

This changes set will add needed unit test cases for User Manager

Change-Id: I848cdbde528d41c2a09abcf35527044b6084f023
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>

show more ...

93804eba01-Oct-2024 Abhilash Raju <abhilash.kollam@gmail.com>

Serialization: Adding Serialization for MFA

This commit will add the persistency of Dbus properties related to MFA.
The configuration file will be stored under
/var/lib/usr_mgr.conf.

Change-Id: Ib7

Serialization: Adding Serialization for MFA

This commit will add the persistency of Dbus properties related to MFA.
The configuration file will be stored under
/var/lib/usr_mgr.conf.

Change-Id: Ib7fdc467c7cb094d328ae670df3bb4352e4a7b91
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>

show more ...

27d5676412-Mar-2025 Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com>

increase maximum username length

This commit is intended to increase the maximum username length.
Currently we set the maximum username length as 30 characters. However
we have usecases where our us

increase maximum username length

This commit is intended to increase the maximum username length.
Currently we set the maximum username length as 30 characters. However
we have usecases where our username are exceeding the limit
(eg: `obmc.svc_openbmc__central_proxy`, length=31). This limitation
prohibit us to create a new account using this username. By increasing
the limit, we now allow creating an account with longer username.

Tested
- Create an account (post request to `/AccountService/Accounts`)
with 31-100 characters -> expect to be success
- Create an account (post request to `/AccountService/Accounts`)
with 101 characters -> expect to be failed

Change-Id: I15c66d2817eb48aea6b3b47be3d5ab85e08b12d0
Signed-off-by: Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com>

show more ...

a1a754c225-Jul-2024 Abhilash Raju <abhilash.kollam@gmail.com>

MFA feature: Enable google authenticator

Enabling multi-factor authentication for BMC. This feature enables
google authenticator using TOTP method.
This commit implements interface published [here][

MFA feature: Enable google authenticator

Enabling multi-factor authentication for BMC. This feature enables
google authenticator using TOTP method.
This commit implements interface published [here][1]
and [here][2]

The implementation supports features such as create secret key,verify
TOTP token, enable system level MFA, and enable bypass options.

Currently the support is only for GoogleAuthenticator.

[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/User/MultiFactorAuthConfiguration.interface.yaml

[2]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/User/TOTPAuthenticator.interface.yaml

Tested By:
Unit test
https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/78583/1

Change-Id: I053095763c65963ff865b487ab08f05039d2fc3a
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>

show more ...

d4d22b0406-Feb-2025 Lei YU <yulei.sh@bytedance.com>

clang-tidy: Enable bugprone-unchecked-optional-access

Enable bugprone-unchecked-optional-access to detect the case that it
accesses std::optional without checking empty.

See https://gerrit.openbmc.

clang-tidy: Enable bugprone-unchecked-optional-access

Enable bugprone-unchecked-optional-access to detect the case that it
accesses std::optional without checking empty.

See https://gerrit.openbmc.org/c/openbmc/docs/+/78034 for details.

Change-Id: I5c2ccf5a734e9769d77c48e0de725ee87fac01af
Signed-off-by: Lei YU <yulei.sh@bytedance.com>

show more ...

123456789