HomeClusterLabs Projects

Refactor: pacemakerd: Use as_root boolean in pcmk_child_t
d53a4a380823Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent 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
Parents
rPe153f1d3ffc5: Refactor: pacemakerd: Remove nesting in start_child()
Branches
Unknown
Tags
Unknown

Event Timeline