abrt  2.10.3.22.gde64.dirty
A tool to inform users about various problems on the running system
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
libabrt.h File Reference
#include <regex.h>
#include <gio/gio.h>
#include "abrt-dbus.h"
#include <libreport/internal_libreport.h>
#include "hooklib.h"

Go to the source code of this file.

Data Structures

struct  abrt_koops_line_info
 

Macros

#define ARRAY_SIZE(x)   ((unsigned)(sizeof(x) / sizeof((x)[0])))
 
#define low_free_space   abrt_low_free_space
 
#define trim_problem_dirs   abrt_trim_problem_dirs
 
#define ensure_writable_dir_id   abrt_ensure_writable_dir_uid_git
 
#define ensure_writable_dir   abrt_ensure_writable_dir
 
#define ensure_writable_dir_group   abrt_ensure_writable_dir_group
 
#define run_unstrip_n   abrt_run_unstrip_n
 
#define get_backtrace   abrt_get_backtrace
 
#define dir_is_in_dump_location   abrt_dir_is_in_dump_location
 
#define dir_has_correct_permissions   abrt_dir_has_correct_permissions
 
#define allowed_new_user_problem_entry   abrt_allowed_new_user_problem_entry
 
#define g_settings_nMaxCrashReportsSize   abrt_g_settings_nMaxCrashReportsSize
 
#define g_settings_sWatchCrashdumpArchiveDir   abrt_g_settings_sWatchCrashdumpArchiveDir
 
#define g_settings_dump_location   abrt_g_settings_dump_location
 
#define g_settings_delete_uploaded   abrt_g_settings_delete_uploaded
 
#define g_settings_autoreporting   abrt_g_settings_autoreporting
 
#define g_settings_autoreporting_event   abrt_g_settings_autoreporting_event
 
#define g_settings_shortenedreporting   abrt_g_settings_shortenedreporting
 
#define g_settings_explorechroots   abrt_g_settings_explorechroots
 
#define g_settings_debug_level   abrt_g_settings_debug_level
 
#define load_abrt_conf   abrt_load_abrt_conf
 
#define free_abrt_conf_data   abrt_free_abrt_conf_data
 
#define load_abrt_conf_file   abrt_load_abrt_conf_file
 
#define load_abrt_plugin_conf_file   abrt_load_abrt_plugin_conf_file
 
#define save_abrt_conf_file   abrt_save_abrt_conf_file
 
#define save_abrt_plugin_conf_file   abrt_save_abrt_plugin_conf_file
 
#define daemon_is_ok   abrt_daemon_is_ok
 
#define notify_new_path   abrt_notify_new_path
 Sends notification to abrtd that a new problem has been detected. More...
 
#define notify_new_path_with_response   abrt_notify_new_path_with_response
 Sends notification to abrtd that a new problem has been detected and wait for the reply. More...
 
#define koops_extract_version   abrt_koops_extract_version
 
#define kernel_tainted_short   abrt_kernel_tainted_short
 
#define kernel_tainted_long   abrt_kernel_tainted_long
 
#define koops_hash_str_ext   abrt_koops_hash_str_ext
 
#define koops_hash_str   abrt_koops_hash_str
 
#define koops_line_skip_level   abrt_koops_line_skip_level
 
#define koops_line_skip_jiffies   abrt_koops_line_skip_jiffies
 
#define koops_extract_oopses_from_lines   abrt_koops_extract_oopses_from_lines
 
#define koops_extract_oopses   abrt_koops_extract_oopses
 
#define koops_suspicious_strings_list   abrt_koops_suspicious_strings_list
 
#define koops_suspicious_strings_blacklist   abrt_koops_suspicious_strings_blacklist
 
#define koops_print_suspicious_strings   abrt_koops_print_suspicious_strings
 
#define koops_print_suspicious_strings_filtered   abrt_koops_print_suspicious_strings_filtered
 

Typedefs

typedef struct ignored_problems ignored_problems_t
 

Enumerations

enum  { DD_PERM_EVENTS = 1 << 0, DD_PERM_DAEMONS = 1 << 1 }
 

Functions

int low_free_space (unsigned setting_MaxCrashReportsSize, const char *dump_location)
 Checks if there is enough free space to store the problem data. More...
 
void trim_problem_dirs (const char *dirname, double cap_size, const char *exclude_path)
 
void ensure_writable_dir_uid_gid (const char *dir, mode_t mode, uid_t uid, gid_t gid)
 
void ensure_writable_dir (const char *dir, mode_t mode, const char *user)
 
void ensure_writable_dir_group (const char *dir, mode_t mode, const char *user, const char *group)
 
char * run_unstrip_n (const char *dump_dir_name, unsigned timeout_sec)
 
char * get_backtrace (const char *dump_dir_name, unsigned timeout_sec, const char *debuginfo_dirs)
 
bool dir_is_in_dump_location (const char *dir_name)
 
bool dir_has_correct_permissions (const char *dir_name, int flags)
 
bool allowed_new_user_problem_entry (uid_t uid, const char *name, const char *value)
 
int load_abrt_conf (void)
 
void free_abrt_conf_data (void)
 
int load_abrt_conf_file (const char *file, map_string_t *settings)
 
int load_abrt_plugin_conf_file (const char *file, map_string_t *settings)
 
int save_abrt_conf_file (const char *file, map_string_t *settings)
 
int save_abrt_plugin_conf_file (const char *file, map_string_t *settings)
 
void migrate_to_xdg_dirs (void)
 
int check_recent_crash_file (const char *filename, const char *executable)
 
int daemon_is_ok (void)
 
void notify_new_path (const char *path)
 
int notify_new_path_with_response (const char *path, char **message)
 
char * koops_extract_version (const char *line)
 
char * kernel_tainted_short (const char *kernel_bt)
 
char * kernel_tainted_long (const char *tainted_short)
 
int koops_hash_str_ext (char hash_str[SHA1_RESULT_LEN *2+1], const char *oops_buf, int frame_count, int duphas_flags)
 
int koops_hash_str (char hash_str[SHA1_RESULT_LEN *2+1], const char *oops_buf)
 
int koops_line_skip_level (const char **c)
 
void koops_line_skip_jiffies (const char **c)
 
void koops_extract_oopses_from_lines (GList **oops_list, const struct abrt_koops_line_info *lines_info, int lines_info_size)
 
void koops_extract_oopses (GList **oops_list, char *buffer, size_t buflen)
 
GList * koops_suspicious_strings_list (void)
 
GList * koops_suspicious_strings_blacklist (void)
 
void koops_print_suspicious_strings (void)
 
void koops_print_suspicious_strings_filtered (const regex_t **filterout)
 
int chown_dir_over_dbus (const char *problem_dir_path)
 Changes the access rights of the problem specified by problem id. More...
 
int test_exist_over_dbus (const char *problem_id, const char *element_name)
 Checks whether the given element name exists. More...
 
int dbus_problem_is_complete (const char *problem_id)
 Checks whether the problem corresponding to the given ID is complete. More...
 
char * load_text_over_dbus (const char *problem_id, const char *element_name)
 
int delete_problem_dirs_over_dbus (const GList *problem_dir_paths)
 Delets multiple problems specified by their id (as returned from problem_data_save) More...
 
int fill_problem_data_over_dbus (const char *problem_dir_path, const char **elements, problem_data_t *problem_data)
 Fetches given problem elements for specified problem id. More...
 
problem_data_t * get_problem_data_dbus (const char *problem_dir_path)
 Fetches problem information for specified problem id. More...
 
problem_data_t * get_full_problem_data_over_dbus (const char *problem_dir_path)
 Fetches full problem data for specified problem id. More...
 
GList * get_problems_over_dbus (bool authorize)
 Fetches all problems from problem database. More...
 
ignored_problems_tignored_problems_new (char *file_path)
 Initializes a new instance of ignored problems. More...
 
void ignored_problems_free (ignored_problems_t *set)
 Destroys an instance of ignored problems. More...
 
void ignored_problems_add (ignored_problems_t *set, const char *problem_id)
 Adds a problem to the ignored problems. More...
 
void ignored_problems_remove (ignored_problems_t *set, const char *problem_id)
 Removes a problem from the ignored problems. More...
 
bool ignored_problems_contains (ignored_problems_t *set, const char *problem_id)
 Checks if a problem is in the ignored problems. More...
 
void ignored_problems_add_problem_data (ignored_problems_t *set, problem_data_t *pd)
 Adds a problem defined by its data to the ignored problems. More...
 
void ignored_problems_remove_problem_data (ignored_problems_t *set, problem_data_t *pd)
 Removes a problem defined by its data from the ignored problems. More...
 
bool ignored_problems_contains_problem_data (ignored_problems_t *set, problem_data_t *pd)
 Checks if a problem defined its data is in the ignored problems. More...
 

Variables

char ** environ
 
unsigned int g_settings_nMaxCrashReportsSize
 
char * g_settings_sWatchCrashdumpArchiveDir
 
char * g_settings_dump_location
 
bool g_settings_delete_uploaded
 
bool g_settings_autoreporting
 
char * g_settings_autoreporting_event
 
bool g_settings_shortenedreporting
 
bool g_settings_explorechroots
 
unsigned int g_settings_debug_level
 

Macro Definition Documentation

◆ koops_print_suspicious_strings_filtered

#define koops_print_suspicious_strings_filtered   abrt_koops_print_suspicious_strings_filtered

Prints all suspicious strings that do not match any of the regular expression in NULL terminated list.

The regular expression should be compiled with REG_NOSUB flag.

Definition at line 175 of file libabrt.h.

◆ notify_new_path

#define notify_new_path   abrt_notify_new_path

Sends notification to abrtd that a new problem has been detected.

Parameters
[in]pathPath to the problem directory containing the problem data

Definition at line 119 of file libabrt.h.

◆ notify_new_path_with_response

#define notify_new_path_with_response   abrt_notify_new_path_with_response

Sends notification to abrtd that a new problem has been detected and wait for the reply.

Parameters
pathPath to the problem directory containing the problem data
messageThe abrtd reply
Returns
-errno on error otherwise return value of abrtd

Definition at line 130 of file libabrt.h.

Function Documentation

◆ chown_dir_over_dbus()

int chown_dir_over_dbus ( const char *  problem_dir_path)

Changes the access rights of the problem specified by problem id.

Requires authorization

Returns
0 if successful; non-zero on failure

◆ dbus_problem_is_complete()

int dbus_problem_is_complete ( const char *  problem_id)

Checks whether the problem corresponding to the given ID is complete.

Might require authorization

Returns
Positive number if the problem is complete, 0 if doesn't and negative number if an error occurs.

◆ delete_problem_dirs_over_dbus()

int delete_problem_dirs_over_dbus ( const GList *  problem_dir_paths)

Delets multiple problems specified by their id (as returned from problem_data_save)

Parameters
problem_dir_pathsList of problem ids
Returns
0 if operation was successful, non-zero on failure

◆ fill_problem_data_over_dbus()

int fill_problem_data_over_dbus ( const char *  problem_dir_path,
const char **  elements,
problem_data_t *  problem_data 
)

Fetches given problem elements for specified problem id.

Returns
returns non-zero value on failures and prints error message

◆ get_full_problem_data_over_dbus()

problem_data_t* get_full_problem_data_over_dbus ( const char *  problem_dir_path)

Fetches full problem data for specified problem id.

Returns
a valid pointer to problem_data_t or ERR_PTR on failure

◆ get_problem_data_dbus()

problem_data_t* get_problem_data_dbus ( const char *  problem_dir_path)

Fetches problem information for specified problem id.

Returns
a valid pointer to problem_data_t or ERR_PTR on failure

◆ get_problems_over_dbus()

GList* get_problems_over_dbus ( bool  authorize)

Fetches all problems from problem database.

Parameters
authorizeIf set to true will try to fetch even problems owned by other users (will require root authorization over policy kit)
Returns
List of problem ids or ERR_PTR on failure (NULL is an empty list)

◆ ignored_problems_add()

void ignored_problems_add ( ignored_problems_t set,
const char *  problem_id 
)

Adds a problem to the ignored problems.

This function never fails. All errors will be logged.

Parameters
setAn instance of ignored problems to which the problem will be added
problem_idAn identifier of a problem which will be added to an ignored set

◆ ignored_problems_add_problem_data()

void ignored_problems_add_problem_data ( ignored_problems_t set,
problem_data_t *  pd 
)

Adds a problem defined by its data to the ignored problems.

This function never fails. All errors will be logged.

Parameters
setAn instance of ignored problems to which the problem will be added
pdA data of a problem which will be added to an ignored set

◆ ignored_problems_contains()

bool ignored_problems_contains ( ignored_problems_t set,
const char *  problem_id 
)

Checks if a problem is in the ignored problems.

This function never fails. All errors will be logged. If any error occurs, the function returns 0 value.

Parameters
setAn instance of ignored problems in which the problem will be searched
problem_idAn identifier of a problem
Returns
Non 0 value if the problem is ignored; otherwise returns 0 value.

◆ ignored_problems_contains_problem_data()

bool ignored_problems_contains_problem_data ( ignored_problems_t set,
problem_data_t *  pd 
)

Checks if a problem defined its data is in the ignored problems.

This function never fails. All errors will be logged. If any error occurs, the function returns 0 value.

Parameters
setAn instance of ignored problems in which the problem will be searched
pdA data of a problem
Returns
Non 0 value if the problem is ignored; otherwise returns 0 value.

◆ ignored_problems_free()

void ignored_problems_free ( ignored_problems_t set)

Destroys an instance of ignored problems.

This function never fails. Supports the common behaviour where it accepts NULL pointers.

Parameters
setA destroyed instance

◆ ignored_problems_new()

ignored_problems_t* ignored_problems_new ( char *  file_path)

Initializes a new instance of ignored problems.

Parameters
file_pathA malloced string holding a path to a file containing the list of ignored problems. Function takes ownership of the malloced memory, which will be freed in ignored_problems_free()
See also
ignored_problems_free()
Returns
Fully initialized instance of ignored problems struct which must be destroyed by ignored_problems_free()

◆ ignored_problems_remove()

void ignored_problems_remove ( ignored_problems_t set,
const char *  problem_id 
)

Removes a problem from the ignored problems.

This function never fails. All errors will be logged.

Parameters
setAn instance of ignored problems from which the problem will be deleted
problem_idAn identifier of a problem which will be removed from an ignored problems struct

◆ ignored_problems_remove_problem_data()

void ignored_problems_remove_problem_data ( ignored_problems_t set,
problem_data_t *  pd 
)

Removes a problem defined by its data from the ignored problems.

This function never fails. All errors will be logged.

Parameters
setAn instance of ignored problems from which the problem will be deleted
pdA data of a problem which will be removed from an ignored problems struct

◆ load_text_over_dbus()

char* load_text_over_dbus ( const char *  problem_id,
const char *  element_name 
)

@ Returns value of the given element name

Might require authorization

Returns
malloced string or NULL if no such an element exists; ERR_PTR in case of any error.

◆ low_free_space()

int low_free_space ( unsigned  setting_MaxCrashReportsSize,
const char *  dump_location 
)

Checks if there is enough free space to store the problem data.

Parameters
setting_MaxCrashReportsSizeMaximum data size
dump_locationLocation to check for the available space

◆ test_exist_over_dbus()

int test_exist_over_dbus ( const char *  problem_id,
const char *  element_name 
)

Checks whether the given element name exists.

Might require authorization

Returns
Positive number if such an element exist, 0 if doesn't and negative number if an error occurs.