20#ifndef LIBREPORT_INTERNAL_H_
21#define LIBREPORT_INTERNAL_H_
39#include <sys/socket.h>
64# define _(S) dgettext(PACKAGE, S)
75#if defined(__GLIBC__) && __GLIBC__ < 2
76int vdprintf(
int d,
const char *format, va_list ap);
80#define NORETURN __attribute__ ((noreturn))
83#define ERR_PTR ((void*)(uintptr_t)1)
86#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
89#define CREATE_PRIVATE_TICKET "ABRT_CREATE_PRIVATE_TICKET"
90#define STOP_ON_NOT_REPORTABLE "ABRT_STOP_ON_NOT_REPORTABLE"
93#define USER_HOME_CONFIG_PATH "/.config/libreport"
96#include "global_configuration.h"
98#include "event_config.h"
101#include "run_event.h"
104#include "libreport_types.h"
105#include "reporters.h"
111int libreport_prefixcmp(
const char *str,
const char *prefix);
112int libreport_suffixcmp(
const char *str,
const char *suffix);
113char *libreport_trim_all_whitespace(
const char *str);
114char *libreport_shorten_string_to_length(
const char *str,
unsigned length);
115char *libreport_strtrim(
char *str);
116char *libreport_strtrimch(
char *str,
int ch);
117char *libreport_strremovech(
char *str,
int ch);
118char *libreport_append_to_malloced_string(
char *mstr,
const char *append);
119char *libreport_skip_blank(
const char *s);
120char *libreport_skip_whitespace(
const char *s);
121char *libreport_skip_non_whitespace(
const char *s);
123void libreport_overlapping_strcpy(
char *dst,
const char *src);
125char *libreport_concat_path_file(
const char *path,
const char *filename);
130char *libreport_concat_path_basename(
const char *path,
const char *filename);
135bool libreport_str_is_correct_filename(
const char *str);
138char *libreport_xmalloc_fgets(FILE *file);
140char *libreport_xmalloc_fgetline(FILE *file);
142char *libreport_xmalloc_fopen_fgetline_fclose(
const char *filename);
146 COPYFD_SPARSE = 1 << 0,
147} libreport_copyfd_flags;
165off_t libreport_copyfd_ext_at(
int src,
int dir_fd,
const char *name,
int mode,
166 uid_t uid, gid_t gid,
int open_flags,
int copy_flags, off_t size);
169off_t libreport_copyfd_eof(
int src_fd,
int dst_fd,
int flags);
170off_t libreport_copyfd_size(
int src_fd,
int dst_fd, off_t size,
int flags);
171void libreport_copyfd_exact_size(
int src_fd,
int dst_fd, off_t size);
172off_t libreport_copy_file_ext_2at(
int src_dir_fd,
const char *src_name,
int dir_fd,
const char *name,
int mode, uid_t uid, gid_t gid,
int src_flags,
int dst_flags);
173off_t libreport_copy_file_ext_at(
const char *src_name,
int dir_fd,
const char *name,
int mode, uid_t uid, gid_t gid,
int src_flags,
int dst_flags);
174#define libreport_copy_file_ext(src_name, dst_name, mode, uid, gid, src_flags, dst_flags) \
175 libreport_copy_file_ext_at(src_name, AT_FDCWD, dst_name, mode, uid, gid, src_flags, dst_flags)
176off_t libreport_copy_file(
const char *src_name,
const char *dst_name,
int mode);
177off_t libreport_copy_file_at(
const char *src_name,
int dir_fd,
const char *name,
int mode);
178int libreport_copy_file_recursive(
const char *source,
const char *dest);
180int libreport_decompress_fd(
int fdi,
int fdo);
181int libreport_decompress_file(
const char *path_in,
const char *path_out, mode_t mode_out);
182int libreport_decompress_file_ext_at(
const char *path_in,
int dir_fd,
const char *path_out,
183 mode_t mode_out, uid_t uid, gid_t gid,
int src_flags,
int dst_flags);
187void libreport_xread(
int fd,
void *buf,
size_t count);
188ssize_t libreport_safe_read(
int fd,
void *buf,
size_t count);
189ssize_t libreport_safe_write(
int fd,
const void *buf,
size_t count);
190ssize_t libreport_full_read(
int fd,
void *buf,
size_t count);
191ssize_t libreport_full_write(
int fd,
const void *buf,
size_t count);
192ssize_t libreport_full_write_str(
int fd,
const char *buf);
193void *libreport_xmalloc_read(
int fd,
size_t *maxsz_p);
194void *libreport_xmalloc_open_read_close(
const char *filename,
size_t *maxsz_p);
195void *libreport_xmalloc_xopen_read_close(
const char *filename,
size_t *maxsz_p);
196char *libreport_malloc_readlink(
const char *linkname);
197char *libreport_malloc_readlinkat(
int dir_fd,
const char *linkname);
201char *libreport_encode_base64(
const void *src,
int length);
207char *libreport_sanitize_utf8(
const char *src, uint32_t control_chars_to_sanitize);
209 SANITIZE_ALL = 0xffffffff,
210 SANITIZE_TAB = (1 << 9),
211 SANITIZE_LF = (1 << 10),
212 SANITIZE_CR = (1 << 13),
215int libreport_try_atou(
const char *numstr,
unsigned *value);
216unsigned libreport_xatou(
const char *numstr);
217int libreport_try_atoi(
const char *numstr,
int *value);
218int libreport_xatoi(
const char *numstr);
226int libreport_try_atoi_positive(
const char *numstr,
int *value);
227int libreport_xatoi_positive(
const char *numstr);
234pid_t libreport_safe_waitpid(pid_t pid,
int *wstat,
int options);
239 EXECFLG_INPUT = 1 << 0,
242 EXECFLG_OUTPUT = 1 << 1,
244 EXECFLG_INPUT_NUL = 1 << 2,
246 EXECFLG_OUTPUT_NUL = 1 << 3,
248 EXECFLG_ERR2OUT = 1 << 4,
250 EXECFLG_ERR_NUL = 1 << 5,
252 EXECFLG_QUIET = 1 << 6,
253 EXECFLG_SETGUID = 1 << 7,
254 EXECFLG_SETSID = 1 << 8,
255 EXECFLG_SETPGID = 1 << 9,
263pid_t libreport_fork_execv_on_steroids(
int flags,
271char *libreport_run_in_shell_and_save_output(
int flags,
278bool libreport_is_in_string_list(
const char *name,
const char *
const *v);
280int libreport_index_of_string_in_list(
const char *name,
const char *
const *v);
282bool libreport_is_in_comma_separated_list(
const char *value,
const char *list);
283bool libreport_is_in_comma_separated_list_of_glob_patterns(
const char *value,
const char *list);
287void libreport_glib_init(
void);
292void libreport_list_free_with_free(GList *list);
294double libreport_get_dirsize(
const char *pPath);
295double libreport_get_dirsize_find_largest_dir(
301int libreport_ndelay_on(
int fd);
302int libreport_ndelay_off(
int fd);
303int libreport_close_on_exec_on(
int fd);
305void *libreport_xmalloc(
size_t size);
306void *libreport_xrealloc(
void *ptr,
size_t size);
307void *libreport_xzalloc(
size_t size);
308char *libreport_xstrdup(
const char *s);
309char *libreport_xstrndup(
const char *s,
int n);
310char *libreport_xstrdup_between(
const char *s,
const char *open,
const char *close);
312void libreport_xpipe(
int filedes[2]);
313int libreport_xdup(
int from);
314void libreport_xdup2(
int from,
int to);
315void libreport_xmove_fd(
int from,
int to);
317void libreport_xwrite(
int fd,
const void *buf,
size_t count);
318void libreport_xwrite_str(
int fd,
const char *str);
320off_t libreport_xlseek(
int fd, off_t offset,
int whence);
322void libreport_xchdir(
const char *path);
324char *libreport_xvasprintf(
const char *format, va_list p);
325char *libreport_xasprintf(
const char *format, ...);
327void libreport_xsetenv(
const char *key,
const char *value);
338void libreport_safe_unsetenv(
const char *var_val);
340int libreport_xsocket(
int domain,
int type,
int protocol);
341void libreport_xbind(
int sockfd,
struct sockaddr *my_addr, socklen_t addrlen);
342void libreport_xlisten(
int s,
int backlog);
343ssize_t libreport_xsendto(
int s,
const void *buf,
size_t len,
344 const struct sockaddr *to, socklen_t tolen);
346void libreport_xstat(
const char *name,
struct stat *stat_buf);
347off_t libreport_fstat_st_size_or_die(
int fd);
348off_t libreport_stat_st_size_or_die(
const char *filename);
350int libreport_xopen3(
const char *pathname,
int flags,
int mode);
351int libreport_xopen(
const char *pathname,
int flags);
352void libreport_xunlink(
const char *pathname);
353void libreport_xunlinkat(
int dir_fd,
const char *pathname,
int flags);
361int libreport_is_regular_file(
struct dirent *dent,
const char *dirname);
362int libreport_is_regular_file_at(
struct dirent *dent,
int dir_fd);
364bool libreport_dot_or_dotdot(
const char *filename);
365char *libreport_last_char_is(
const char *s,
int c);
367bool libreport_string_to_bool(
const char *s);
369void libreport_xseteuid(uid_t euid);
370void libreport_xsetegid(gid_t egid);
371void libreport_xsetreuid(uid_t ruid, uid_t euid);
372void libreport_xsetregid(gid_t rgid, gid_t egid);
374FILE *libreport_xfdopen(
int fd,
const char *mode);
377char *libreport_bin2hex(
char *dst,
const char *str,
int count);
379char* libreport_hex2bin(
char *dst,
const char *str,
int count);
384 LOGMODE_STDIO = (1 << 0),
385 LOGMODE_SYSLOG = (1 << 1),
386 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
387 LOGMODE_CUSTOM = (1 << 2),
388 LOGMODE_JOURNAL = (1 << 3),
391enum libreport_diemode {
396extern void (*libreport_g_custom_logger)(
const char*);
397extern const char *libreport_msg_prefix;
398extern const char *libreport_msg_eol;
399extern int libreport_logmode;
400extern int libreport_xfunc_error_retval;
403#define EXIT_CANCEL_BY_USER 69
404#define EXIT_STOP_EVENT_RUN 70
406void libreport_set_xfunc_error_retval(
int retval);
408void libreport_set_xfunc_diemode(
enum libreport_diemode mode);
411extern int libreport_g_verbose;
413#define VERB1 if (libreport_g_verbose >= 1)
415#define VERB2 if (libreport_g_verbose >= 2)
417#define VERB3 if (libreport_g_verbose >= 3)
421void libreport_xfunc_die(
void) NORETURN;
423void libreport_die_out_of_memory(
void) NORETURN;
427#define log_warning(...) log_standard(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
428#define log_debug(...) log_standard(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
429#define log_info(...) log_standard(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
430#define log_notice(...) log_standard(LOG_NOTICE, __FILE__, __LINE__, __func__, __VA_ARGS__)
431#define log_warning(...) log_standard(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
432#define log_error(...) log_standard(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
435#define log_parser(...) if(0) log_debug(__VA_ARGS__)
437#define log_standard(level, file, line, func, ...) log_wrapper(level, __FILE__, __LINE__, __func__, false, false, __VA_ARGS__)
440#define log_error_and_die(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, false,__VA_ARGS__)
441#define log_perror(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, false, __VA_ARGS__)
442#define log_perror_and_die(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, false, __VA_ARGS__)
444#define error_msg(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
445#define perror_msg(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
446#define warn_msg(...) log_wrapper(LOG_WARNING, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
447#define pwarn_msg(...) log_wrapper(LOG_WARNING, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
448#define notice_msg(...) log_wrapper(LOG_NOTICE, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
449#define pnotice_msg(...) log_wrapper(LOG_NOTICE, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
450#define error_msg_and_die(...) log_and_die_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
451#define perror_msg_and_die(...) log_and_die_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
454void log_wrapper(
int level,
459 bool use_custom_logger,
460 const char *format, ...) __attribute__ ((format (printf, 7,8)));
462void log_and_die_wrapper(
int level,
467 bool use_custom_logger,
468 const
char *format, ...) __attribute__ ((noreturn, format (printf, 7,8)));
485struct strbuf *libreport_strbuf_new(
void);
499char *libreport_strbuf_free_nobuf(
struct strbuf *
strbuf);
532 const char *format, ...);
539 const char *format, va_list p);
547 const char *format, ...);
554 const char *format, va_list p);
561int libreport_open_proc_pid_dir(pid_t pid);
562char *libreport_get_cmdline_at(pid_t pid);
563char *libreport_get_cmdline(pid_t pid);
564char *libreport_get_environ_at(pid_t pid);
565char *libreport_get_environ(pid_t pid);
566char *libreport_get_executable_at(pid_t pid);
567char *libreport_get_executable(pid_t pid);
568char *libreport_get_cwd_at(pid_t pid);
569char *libreport_get_cwd(pid_t pid);
570char *libreport_get_rootdir_at(pid_t pid);
571char *libreport_get_rootdir(pid_t pid);
573int libreport_get_fsuid(
const char *proc_pid_status);
574int libreport_get_fsgid(
const char *proc_pid_status);
575int libreport_dump_fd_info_at(
int pid_proc_fd, FILE *dest);
576int libreport_dump_fd_info_ext(
const char *dest_filename,
const char *proc_pid_fd_path, uid_t uid, gid_t gid);
577int libreport_dump_fd_info(
const char *dest_filename,
const char *proc_pid_fd_path);
578int libreport_get_env_variable_ext(
int fd,
char delim,
const char *name,
char **value);
579int libreport_get_env_variable(pid_t pid,
const char *name,
char **value);
581#define PROC_NS_UNSUPPORTED ((ino_t)-1)
582#define PROC_NS_ID_CGROUP 0
583#define PROC_NS_ID_IPC 1
584#define PROC_NS_ID_MNT 2
585#define PROC_NS_ID_NET 3
586#define PROC_NS_ID_PID 4
587#define PROC_NS_ID_TIME 6
588#define PROC_NS_ID_USER 8
589#define PROC_NS_ID_UTS 9
590static const char * libreport_proc_namespaces[] = {
604 ino_t nsi_ids[ARRAY_SIZE(libreport_proc_namespaces)];
607int libreport_get_ns_ids_at(
int pid_proc_fd,
struct ns_ids *ids);
608int libreport_get_ns_ids(pid_t pid,
struct ns_ids *ids);
613int libreport_process_has_own_root_at(
int proc_pid_fd);
614int libreport_process_has_own_root(pid_t pid);
616int libreport_get_pid_of_container_at(
int pid_proc_fd, pid_t *init_pid);
617int libreport_get_pid_of_container(pid_t pid, pid_t *init_pid);
618int libreport_dump_namespace_diff_at(
int base_pid_proc_fd,
int tested_pid_proc_fd, FILE *dest);
619int libreport_dump_namespace_diff_ext(
const char *dest_filename, pid_t base_pid, pid_t tested_pid, uid_t uid, gid_t gid);
620int libreport_dump_namespace_diff(
const char *dest_filename, pid_t base_pid, pid_t tested_pid);
624 MOUNTINFO_INDEX_MOUNT_ID,
625 MOUNTINFO_INDEX_PARENT_ID,
626 MOUNTINFO_INDEX_MAJOR_MINOR,
627 MOUNTINFO_INDEX_ROOT,
628 MOUNTINFO_INDEX_MOUNT_POINT,
629 MOUNTINFO_INDEX_MOUNT_OPTIONS,
630 MOUNTINFO_INDEX_OPTIONAL_FIELDS,
631 MOUNTINFO_INDEX_FS_TYPE,
632 MOUNTINFO_INDEX_MOUNT_SOURCE,
633 MOUNTINFO_INDEX_SUPER_OPITONS,
634 _MOUNTINFO_INDEX_MAX,
637#define MOUNTINFO_ROOT(val) (val.mntnf_items[MOUNTINFO_INDEX_ROOT])
638#define MOUNTINFO_MOUNT_POINT(val) (val.mntnf_items[MOUNTINFO_INDEX_MOUNT_POINT])
639#define MOUNTINFO_MOUNT_SOURCE(val) (val.mntnf_items[MOUNTINFO_INDEX_MOUNT_SOURCE])
648 char *mntnf_items[_MOUNTINFO_INDEX_MAX];
650void libreport_mountinfo_destroy(
struct mountinfo *mntnf);
651int libreport_get_mountinfo_for_mount_point(FILE *fin,
struct mountinfo *mntnf,
const char *mnt_point);
656char *libreport_iso_date_string(
const time_t *pt);
657#define LIBREPORT_ISO_DATE_STRING_SAMPLE "YYYY-MM-DD-hh:mm:ss"
658#define LIBREPORT_ISO_DATE_STRING_FORMAT "%Y-%m-%d-%H:%M:%S"
667int libreport_iso_date_string_parse(
const char *date, time_t *pt);
670 MAKEDESC_SHOW_FILES = (1 << 0),
671 MAKEDESC_SHOW_MULTILINE = (1 << 1),
672 MAKEDESC_SHOW_ONLY_LIST = (1 << 2),
673 MAKEDESC_WHITELIST = (1 << 3),
675 MAKEDESC_SHOW_URLS = (1 << 4),
677char *libreport_make_description(problem_data_t *problem_data,
char **names_to_skip,
unsigned max_text_size,
unsigned desc_flags);
678char *libreport_make_description_logger(problem_data_t *problem_data,
unsigned max_text_size);
681#define OSINFO_ID "ID"
682#define OSINFO_NAME "NAME"
683#define OSINFO_VERSION_ID "VERSION_ID"
684#define OSINFO_PRETTY_NAME "PRETTY_NAME"
695void libreport_parse_osinfo(
const char *osinfo_bytes, map_string_t *osinfo);
711void libreport_parse_osinfo_for_bz(map_string_t *osinfo,
char **product,
char **version);
724void libreport_parse_osinfo_for_bug_url(map_string_t *osinfo,
char** url);
740void libreport_parse_osinfo_for_rhts(map_string_t *osinfo,
char **product,
char **version);
742void libreport_parse_release_for_bz(
const char *pRelease,
char **product,
char **version);
743void libreport_parse_release_for_rhts(
const char *pRelease,
char **product,
char **version);
759bool libreport_load_conf_file(
const char *pPath, map_string_t *settings,
bool skipKeysWithoutValue);
760bool libreport_load_plugin_conf_file(
const char *name, map_string_t *settings,
bool skipKeysWithoutValue);
762const char *libreport_get_user_conf_base_dir(
void);
764bool libreport_load_conf_file_from_dirs(
const char *base_name,
const char *
const *directories, map_string_t *settings,
bool skipKeysWithoutValue);
767 CONF_DIR_FLAG_NONE = 0,
768 CONF_DIR_FLAG_OPTIONAL = 1,
771bool libreport_load_conf_file_from_dirs_ext(
const char *base_name,
const char *
const *directories,
772 const int * dir_flags, map_string_t *settings,
773 bool skipKeysWithoutValue);
775bool libreport_save_conf_file(
const char *path, map_string_t *settings);
776bool libreport_save_plugin_conf_file(
const char *name, map_string_t *settings);
778bool libreport_save_app_conf_file(
const char* application_name, map_string_t *settings);
779bool libreport_load_app_conf_file(
const char *application_name, map_string_t *settings);
780void libreport_set_app_user_setting(map_string_t *settings,
const char *name,
const char *value);
781const char *libreport_get_app_user_setting(map_string_t *settings,
const char *name);
783bool libreport_save_user_settings(
void);
784bool libreport_load_user_settings(
const char *application_name);
785void libreport_set_user_setting(
const char *name,
const char *value);
786const char *libreport_get_user_setting(
const char *name);
791GList *libreport_load_words_from_file(
const char *filename);
792GList *libreport_get_file_list(
const char *path,
const char *ext);
793void libreport_free_file_list(GList *filelist);
794file_obj_t *libreport_new_file_obj(
const char* fullpath,
const char* filename);
796GList *libreport_parse_delimited_list(
const char *
string,
const char *delimiter);
799int delete_dump_dir_possibly_using_abrtd(
const char *dump_dir_name);
803struct dump_dir *libreport_steal_directory(
const char *base_dir,
const char *dump_dir_name);
811bool libreport_uid_in_group(uid_t uid, gid_t gid);
819struct dump_dir *libreport_open_directory_for_writing(
820 const char *dump_dir_name,
821 bool (*ask_continue)(
const char *,
const char *));
837#define CD_MAX_TEXT_SIZE (8*1024*1024)
843#define CD_TEXT_ATT_SIZE_BZ (4*1024)
845#define CD_TEXT_ATT_SIZE_LOGGER (CD_MAX_TEXT_SIZE)
849#define FILENAME_TIME "time"
850#define FILENAME_LAST_OCCURRENCE "last_occurrence"
851#define FILENAME_REASON "reason"
852#define FILENAME_UID "uid"
866#define FILENAME_ANALYZER "analyzer"
867#define FILENAME_TYPE "type"
868#define FILENAME_EXECUTABLE "executable"
869#define FILENAME_PID "pid"
870#define FILENAME_TID "tid"
871#define FILENAME_GLOBAL_PID "global_pid"
872#define FILENAME_PWD "pwd"
873#define FILENAME_ROOTDIR "rootdir"
874#define FILENAME_BINARY "binary"
875#define FILENAME_CMDLINE "cmdline"
876#define FILENAME_COREDUMP "coredump"
877#define FILENAME_CGROUP "cgroup"
878#define FILENAME_BACKTRACE "backtrace"
879#define FILENAME_MAPS "maps"
880#define FILENAME_SMAPS "smaps"
881#define FILENAME_PROC_PID_STATUS "proc_pid_status"
882#define FILENAME_ENVIRON "environ"
883#define FILENAME_LIMITS "limits"
884#define FILENAME_OPEN_FDS "open_fds"
885#define FILENAME_MOUNTINFO "mountinfo"
886#define FILENAME_NAMESPACES "namespaces"
887#define FILENAME_CPUINFO "cpuinfo"
892#define FILENAME_DUPHASH "duphash"
896#define FILENAME_CRASH_FUNCTION "crash_function"
897#define FILENAME_ARCHITECTURE "architecture"
898#define FILENAME_KERNEL "kernel"
905#define FILENAME_OS_INFO "os_info"
906#define FILENAME_OS_INFO_IN_ROOTDIR "os_info_in_rootdir"
908#define FILENAME_OS_RELEASE "os_release"
909#define FILENAME_OS_RELEASE_IN_ROOTDIR "os_release_in_rootdir"
911#define FILENAME_PACKAGE "package"
912#define FILENAME_COMPONENT "component"
913#define FILENAME_COMMENT "comment"
914#define FILENAME_RATING "backtrace_rating"
915#define FILENAME_HOSTNAME "hostname"
917#define FILENAME_REMOTE "remote"
918#define FILENAME_TAINTED "kernel_tainted"
919#define FILENAME_TAINTED_SHORT "kernel_tainted_short"
920#define FILENAME_TAINTED_LONG "kernel_tainted_long"
921#define FILENAME_VMCORE "vmcore"
922#define FILENAME_KERNEL_LOG "kernel_log"
925#define FILENAME_DESCRIPTION "description"
931#define FILENAME_UUID "uuid"
933#define FILENAME_COUNT "count"
940#define FILENAME_REPORTED_TO "reported_to"
941#define FILENAME_EVENT_LOG "event_log"
947#define FILENAME_NOT_REPORTABLE "not-reportable"
948#define FILENAME_CORE_BACKTRACE "core_backtrace"
949#define FILENAME_REMOTE_RESULT "remote_result"
950#define FILENAME_PKG_EPOCH "pkg_epoch"
951#define FILENAME_PKG_NAME "pkg_name"
952#define FILENAME_PKG_VERSION "pkg_version"
953#define FILENAME_PKG_RELEASE "pkg_release"
954#define FILENAME_PKG_ARCH "pkg_arch"
957#define FILENAME_PKG_VENDOR "pkg_vendor"
959#define FILENAME_PKG_FINGERPRINT "pkg_fingerprint"
961#define FILENAME_USERNAME "username"
962#define FILENAME_ABRT_VERSION "abrt_version"
963#define FILENAME_EXPLOITABLE "exploitable"
966#define FILENAME_REPRODUCIBLE "reproducible"
967#define FILENAME_REPRODUCER "reproducer"
971#define FILENAME_KICKSTART_CFG "ks.cfg"
972#define FILENAME_ANACONDA_TB "anaconda-tb"
976#define FILENAME_CONTAINER "container"
977#define FILENAME_CONTAINER_ID "container_id"
978#define FILENAME_CONTAINER_UUID "container_uuid"
979#define FILENAME_CONTAINER_IMAGE "container_image"
980#define FILENAME_CONTAINER_CMDLINE "container_cmdline"
982#define FILENAME_CONTAINER_ROOTFS "container_rootfs"
983#define FILENAME_DOCKER_INSPECT "docker_inspect"
988#define FILENAME_EXCEPTION_TYPE "exception_type"
991#define CD_DUMPDIR "Directory"
993gint libreport_cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename);
1004 EVENT_LOG_HIGH_WATERMARK = 30 * 1024,
1005 EVENT_LOG_LOW_WATERMARK = 20 * 1024,
1008void libreport_log_problem_data(problem_data_t *problem_data,
const char *pfx);
1010extern int g_libreport_inited;
1011void libreport_init(
void);
1013#define INITIALIZE_LIBREPORT() \
1016 if (!g_libreport_inited) \
1018 g_libreport_inited = 1; \
1024const char *abrt_init(
char **argv);
1025void libreport_export_abrt_envvars(
int pfx);
1026extern const char *libreport_g_progname;
1028enum parse_opt_type {
1039 enum parse_opt_type type;
1041 const char *long_name;
1054#define OPT_END() { OPTION_END }
1055#define OPT_GROUP(h) { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }
1056#define OPT_BOOL( s, l, v, h) { OPTION_BOOL , (s), (l), (v), NULL , (h) }
1057#define OPT_INTEGER( s, l, v, h) { OPTION_INTEGER , (s), (l), (v), "NUM", (h) }
1058#define OPT_STRING( s, l, v, a, h) { OPTION_STRING , (s), (l), (v), (a) , (h) }
1059#define OPT_OPTSTRING(s, l, v, a, h) { OPTION_OPTSTRING, (s), (l), (v), (a) , (h) }
1060#define OPT_LIST( s, l, v, a, h) { OPTION_LIST , (s), (l), (v), (a) , (h) }
1062#define OPT__VERBOSE(v) OPT_BOOL('v', "verbose", (v), _("Be verbose"))
1063#define OPT__DUMP_DIR(v) OPT_STRING('d', "problem-dir", (v), "DIR", _("Problem directory"))
1065unsigned libreport_parse_opts(
int argc,
char **argv,
const struct options *opt,
1068void libreport_show_usage_and_die(
const char *usage,
const struct options *opt) NORETURN;
1073struct abrt_post_state;
1094int libreport_uri_userinfo_remove(
const char *uri,
char **result,
char **scheme,
char **hostname,
char **username,
char **password,
char **location);