HomeClusterLabs Projects

Low: libcrmcommon: use return code correctly when getting daemon user ID

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Low: libcrmcommon: use return code correctly when getting daemon user ID

Previously, pcmk_daemon_user() would return pcmk_ok only on the first
successful call -- subsequent (successful) calls would always return
pcmk_err_generic, even though the IDs were available.

This didn't cause problems because all the callers except one checked whether
the return value was negative, and pcmk_err_generic isn't negative, so they
treated it like success. Now, pcmk_daemon_user() will always return a negative
value for errors, so everything now works as intended rather than by accident.

The one caller that checked for pcmk_ok was crm_add_logfile(). The effect would
be that if crm_add_logfile() were called after pcmk_daemon_user() had already
been called at least once, it would not change the ownership and mode of the
log file. This will now work correctly.

Details

Provenance
kgaillotAuthored on May 17 2021, 12:22 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.