pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
acl_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2024 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef CRM_COMMON_ACL_INTERNAL__H
11 #define CRM_COMMON_ACL_INTERNAL__H
12 
13 #include <string.h> // strcmp()
14 #include <libxml/tree.h> // xmlNode
15 
16 #include <crm/common/xml_internal.h> // enum xml_private_flags
17 
18 /* internal ACL-related utilities */
19 
20 char *pcmk__uid2username(uid_t uid);
21 const char *pcmk__update_acl_user(xmlNode *request, const char *field,
22  const char *peer_user);
23 
24 static inline bool
25 pcmk__is_privileged(const char *user)
26 {
27  return user && (!strcmp(user, CRM_DAEMON_USER) || !strcmp(user, "root"));
28 }
29 
30 void pcmk__enable_acl(xmlNode *acl_source, xmlNode *target, const char *user);
31 
32 bool pcmk__check_acl(xmlNode *xml, const char *name,
33  enum xml_private_flags mode);
34 
35 #endif /* CRM_COMMON_INTERNAL__H */
const char * name
Definition: cib.c:26
char * pcmk__uid2username(uid_t uid)
Definition: acl.c:769
const char * pcmk__update_acl_user(xmlNode *request, const char *field, const char *peer_user)
Definition: acl.c:799
#define CRM_DAEMON_USER
Definition: config.h:30
xml_private_flags
Definition: xml_internal.h:519
const char * target
Definition: pcmk_fence.c:29
void pcmk__enable_acl(xmlNode *acl_source, xmlNode *target, const char *user)
Definition: acl.c:354
bool pcmk__check_acl(xmlNode *xml, const char *name, enum xml_private_flags mode)
Definition: acl.c:658