#include <crm_internal.h>
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <libxml/tree.h>
#include <libxml/xmlstring.h>
#include <libxml/xpath.h>
#include <crm/crm.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include "crmcommon_private.h"
Go to the source code of this file.
|
void | pcmk__free_acls (GList *acls) |
|
void | pcmk__apply_acl (xmlNode *xml) |
|
void | pcmk__unpack_acl (xmlNode *source, xmlNode *target, const char *user) |
|
void | pcmk__enable_acl (xmlNode *acl_source, xmlNode *target, const char *user) |
|
bool | xml_acl_filtered_copy (const char *user, xmlNode *acl_source, xmlNode *xml, xmlNode **result) |
| Copy ACL-allowed portions of specified XML.
|
|
void | pcmk__apply_creation_acl (xmlNode *xml, bool check_top) |
|
bool | xml_acl_denied (const xmlNode *xml) |
| Check whether or not an XML node is ACL-denied.
|
|
void | xml_acl_disable (xmlNode *xml) |
|
bool | xml_acl_enabled (const xmlNode *xml) |
| Check whether or not an XML node is ACL-enabled.
|
|
bool | pcmk__check_acl (xmlNode *xml, const char *attr_name, enum pcmk__xml_flags mode) |
|
bool | pcmk_acl_required (const char *user) |
| Check whether ACLs are required for a given user.
|
|
char * | pcmk__uid2username (uid_t uid) |
|
const char * | pcmk__update_acl_user (xmlNode *request, const char *field, const char *peer_user) |
|
◆ check_acl_deny
#define check_acl_deny |
( |
| xml, |
|
|
| attr_name, |
|
|
| prefix, |
|
|
| user, |
|
|
| mode ) |
Value: do { \
xmlNode *tree = xml; \
\
pcmk__if_tracing( \
{ \
\
if ((attr_name) != NULL) { \
pcmk__g_strcat(xpath, "[@", attr_name, "]", NULL); \
} \
qb_log_from_external_source(__func__, __FILE__, \
"%sACL denies user '%s' %s " \
"access to %s", \
prefix, user, \
acl_to_text(mode), xpath->str); \
g_string_free(xpath, TRUE); \
}, \
{} \
); \
} while (false);
@ pcmk__xf_acl_denied
ACLs deny the user access (set for document only)
GString * pcmk__element_xpath(const xmlNode *xml)
Definition at line 724 of file acl.c.
◆ display_id
#define display_id |
( |
| xml | ) |
|
Value:pcmk__s(pcmk__xe_id(xml), "<unset>")
Definition at line 594 of file acl.c.
◆ xml_acl_t
◆ pcmk__apply_acl()
void pcmk__apply_acl |
( |
xmlNode * | xml | ) |
|
◆ pcmk__apply_creation_acl()
void pcmk__apply_creation_acl |
( |
xmlNode * | xml, |
|
|
bool | check_top ) |
◆ pcmk__check_acl()
bool pcmk__check_acl |
( |
xmlNode * | xml, |
|
|
const char * | attr_name, |
|
|
enum pcmk__xml_flags | mode ) |
◆ pcmk__enable_acl()
void pcmk__enable_acl |
( |
xmlNode * | acl_source, |
|
|
xmlNode * | target, |
|
|
const char * | user ) |
◆ pcmk__free_acls()
void pcmk__free_acls |
( |
GList * | acls | ) |
|
Definition at line 45 of file acl.c.
◆ pcmk__uid2username()
char * pcmk__uid2username |
( |
uid_t | uid | ) |
|
◆ pcmk__unpack_acl()
void pcmk__unpack_acl |
( |
xmlNode * | source, |
|
|
xmlNode * | target, |
|
|
const char * | user ) |
◆ pcmk__update_acl_user()
const char * pcmk__update_acl_user |
( |
xmlNode * | request, |
|
|
const char * | field, |
|
|
const char * | peer_user ) |
◆ pcmk_acl_required()
bool pcmk_acl_required |
( |
const char * | user | ) |
|
Check whether ACLs are required for a given user.
- Parameters
-
- Returns
- true if the user requires ACLs, false otherwise
Definition at line 808 of file acl.c.
◆ xml_acl_denied()
bool xml_acl_denied |
( |
const xmlNode * | xml | ) |
|
Check whether or not an XML node is ACL-denied.
- Parameters
-
- Returns
- true if XML node exists and is ACL-denied, false otherwise
Definition at line 671 of file acl.c.
◆ xml_acl_disable()
void xml_acl_disable |
( |
xmlNode * | xml | ) |
|
◆ xml_acl_enabled()
bool xml_acl_enabled |
( |
const xmlNode * | xml | ) |
|
Check whether or not an XML node is ACL-enabled.
- Parameters
-
- Returns
- true if XML node exists and is ACL-enabled, false otherwise
Definition at line 702 of file acl.c.
◆ xml_acl_filtered_copy()
bool xml_acl_filtered_copy |
( |
const char * | user, |
|
|
xmlNode * | acl_source, |
|
|
xmlNode * | xml, |
|
|
xmlNode ** | result ) |
Copy ACL-allowed portions of specified XML.
- Parameters
-
[in] | user | Username whose ACLs should be used |
[in] | acl_source | XML containing ACLs |
[in] | xml | XML to be copied |
[out] | result | Copy of XML portions readable via ACLs |
- Returns
- true if xml exists and ACLs are required for user, false otherwise
- Note
- If this returns true, caller should use
result
rather than xml
Definition at line 473 of file acl.c.