pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Macros | Typedefs | Functions
acl.c File Reference
#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 <crm/crm.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include "crmcommon_private.h"
Include dependency graph for acl.c:

Go to the source code of this file.

Macros

#define display_id(xml)   pcmk__s(pcmk__xe_id(xml), "<unset>")
 

Typedefs

typedef struct xml_acl_s xml_acl_t
 

Functions

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. More...
 
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. More...
 
void xml_acl_disable (xmlNode *xml)
 
bool xml_acl_enabled (const xmlNode *xml)
 Check whether or not an XML node is ACL-enabled. More...
 
bool pcmk__check_acl (xmlNode *xml, const char *name, enum xml_private_flags mode)
 
bool pcmk_acl_required (const char *user)
 Check whether ACLs are required for a given user. More...
 
char * pcmk__uid2username (uid_t uid)
 
const char * pcmk__update_acl_user (xmlNode *request, const char *field, const char *peer_user)
 

Macro Definition Documentation

◆ display_id

#define display_id (   xml)    pcmk__s(pcmk__xe_id(xml), "<unset>")

Definition at line 555 of file acl.c.

Typedef Documentation

◆ xml_acl_t

typedef struct xml_acl_s xml_acl_t

Function Documentation

◆ pcmk__apply_acl()

void pcmk__apply_acl ( xmlNode *  xml)

Definition at line 230 of file acl.c.

◆ pcmk__apply_creation_acl()

void pcmk__apply_creation_acl ( xmlNode *  xml,
bool  check_top 
)

Definition at line 573 of file acl.c.

◆ pcmk__check_acl()

bool pcmk__check_acl ( xmlNode *  xml,
const char *  name,
enum xml_private_flags  mode 
)

Definition at line 658 of file acl.c.

◆ pcmk__enable_acl()

void pcmk__enable_acl ( xmlNode *  acl_source,
xmlNode *  target,
const char *  user 
)

Definition at line 354 of file acl.c.

◆ pcmk__free_acls()

void pcmk__free_acls ( GList *  acls)

Definition at line 43 of file acl.c.

◆ pcmk__uid2username()

char* pcmk__uid2username ( uid_t  uid)

Definition at line 769 of file acl.c.

◆ pcmk__unpack_acl()

void pcmk__unpack_acl ( xmlNode *  source,
xmlNode *  target,
const char *  user 
)

Definition at line 288 of file acl.c.

◆ pcmk__update_acl_user()

const char* pcmk__update_acl_user ( xmlNode *  request,
const char *  field,
const char *  peer_user 
)

Definition at line 799 of file acl.c.

◆ pcmk_acl_required()

bool pcmk_acl_required ( const char *  user)

Check whether ACLs are required for a given user.

Parameters
[in]Username to check
Returns
true if the user requires ACLs, false otherwise

Definition at line 754 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
[in]xmlnode to check
Returns
true if XML node exists and is ACL-denied, false otherwise

Definition at line 616 of file acl.c.

◆ xml_acl_disable()

void xml_acl_disable ( xmlNode *  xml)

Definition at line 627 of file acl.c.

◆ xml_acl_enabled()

bool xml_acl_enabled ( const xmlNode *  xml)

Check whether or not an XML node is ACL-enabled.

Parameters
[in]xmlnode to check
Returns
true if XML node exists and is ACL-enabled, false otherwise

Definition at line 647 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]userUsername whose ACLs should be used
[in]acl_sourceXML containing ACLs
[in]xmlXML to be copied
[out]resultCopy 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 445 of file acl.c.