HomeClusterLabs Projects

Refactor: pacemakerd: New child_as_root flag for pcmk_child_t

Description

Refactor: pacemakerd: New child_as_root flag for pcmk_child_t

There are really only two options for uid: 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 a flag 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 Tue, Sep 16, 8:20 PM
Parents
rPb531520fcf5f: Refactor: pacemakerd: Remove more nesting in start_child()
Branches
Unknown
Tags
Unknown