HomeClusterLabs Projects

Refactor: pacemakerd: Use as_root boolean in pcmk_child_t
7a3b6ad1e26cUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Refactor: pacemakerd: Use as_root boolean in pcmk_child_t

There are really only two options: root and CRM_DAEMON_USER. The
generality of pcmk_child_t:uid made things a bit harder to follow. Plus
the name "uid" suggested a numeric UID.

Using an as_root boolean value simplifies the code a bit and allows us
to use pcmk_daemon_user() instead of crm_user_lookup(). This way, we
only have to do the lookup once. After that, the uid and gid are cached
in static variables within pcmk_daemon_user().

There are probably other opportunities to take advantage of the fact
that uid and gid are either root or the CRM_DAEMON_USER's uid and gid.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 24 2025, 3:27 AM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.