pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Functions | Variables
utils.c File Reference
#include <crm_internal.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <pwd.h>
#include <time.h>
#include <libgen.h>
#include <signal.h>
#include <grp.h>
#include <qb/qbdefs.h>
#include <crm/crm.h>
#include <crm/services.h>
#include <crm/cib/internal.h>
#include <crm/common/xml.h>
#include <crm/common/util.h>
#include <crm/common/ipc.h>
#include <crm/common/iso8601.h>
#include <crm/common/mainloop.h>
#include <libxml2/libxml/relaxng.h>
#include "crmcommon_private.h"
#include <crm/common/util_compat.h>
Include dependency graph for utils.c:

Go to the source code of this file.

Functions

 CRM_TRACE_INIT_DATA (common)
 
void pcmk_common_cleanup (void)
 Free all memory used by libcrmcommon. More...
 
bool pcmk__is_user_in_group (const char *user, const char *group)
 
int crm_user_lookup (const char *name, uid_t *uid, gid_t *gid)
 
int pcmk_daemon_user (uid_t *uid, gid_t *gid)
 Get user and group IDs of pacemaker daemon user. More...
 
int compare_version (const char *version1, const char *version2)
 
void pcmk__daemonize (const char *name, const char *pidfile)
 
char * crm_generate_uuid (void)
 
void pcmk__sleep_ms (unsigned int ms)
 
guint pcmk__create_timer (guint interval_ms, GSourceFunc fn, gpointer data)
 
guint pcmk__timeout_ms2s (guint timeout_ms)
 
void crm_gnutls_global_init (void)
 
bool crm_is_daemon_name (const char *name)
 Check whether string represents a client name used by cluster daemons. More...
 

Variables

bool pcmk__config_has_error = false
 
bool pcmk__config_has_warning = false
 
char * crm_system_name = NULL
 

Function Documentation

◆ compare_version()

int compare_version ( const char *  version1,
const char *  version2 
)

Definition at line 202 of file utils.c.

◆ crm_generate_uuid()

char* crm_generate_uuid ( void  )

Definition at line 335 of file utils.c.

◆ crm_gnutls_global_init()

void crm_gnutls_global_init ( void  )
Deprecated:
Use gnutls_global_init() instead

Definition at line 457 of file utils.c.

◆ crm_is_daemon_name()

bool crm_is_daemon_name ( const char *  name)

Check whether string represents a client name used by cluster daemons.

Parameters
[in]nameString to check
Returns
true if name is standard client name used by daemons, false otherwise
Note
This is provided by the client, and so cannot be used by itself as a secure means of authentication.

Definition at line 476 of file utils.c.

◆ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( common  )

◆ crm_user_lookup()

int crm_user_lookup ( const char *  name,
uid_t *  uid,
gid_t *  gid 
)

Definition at line 99 of file utils.c.

◆ pcmk__create_timer()

guint pcmk__create_timer ( guint  interval_ms,
GSourceFunc  fn,
gpointer  data 
)

Definition at line 401 of file utils.c.

◆ pcmk__daemonize()

void pcmk__daemonize ( const char *  name,
const char *  pidfile 
)

Definition at line 284 of file utils.c.

◆ pcmk__is_user_in_group()

bool pcmk__is_user_in_group ( const char *  user,
const char *  group 
)

Definition at line 67 of file utils.c.

◆ pcmk__sleep_ms()

void pcmk__sleep_ms ( unsigned int  ms)

Definition at line 355 of file utils.c.

◆ pcmk__timeout_ms2s()

guint pcmk__timeout_ms2s ( guint  timeout_ms)

Definition at line 425 of file utils.c.

◆ pcmk_common_cleanup()

void pcmk_common_cleanup ( void  )

Free all memory used by libcrmcommon.

Free all global memory allocated by the libcrmcommon library. This should be called before exiting a process that uses the library, and the process should not call any libcrmcommon or libxml2 APIs after calling this one.

Definition at line 54 of file utils.c.

◆ pcmk_daemon_user()

int pcmk_daemon_user ( uid_t *  uid,
gid_t *  gid 
)

Get user and group IDs of pacemaker daemon user.

Parameters
[out]uidIf non-NULL, where to store daemon user ID
[out]gidIf non-NULL, where to store daemon group ID
Returns
pcmk_ok on success, -errno otherwise

Definition at line 139 of file utils.c.

Variable Documentation

◆ crm_system_name

char* crm_system_name = NULL

Definition at line 44 of file utils.c.

◆ pcmk__config_has_error

bool pcmk__config_has_error = false

Definition at line 42 of file utils.c.

◆ pcmk__config_has_warning

bool pcmk__config_has_warning = false

Definition at line 43 of file utils.c.