20 #ifndef LIBREPORT_INTERNAL_H_
21 #define LIBREPORT_INTERNAL_H_
39 #include <sys/socket.h>
42 #include <sys/types.h>
44 #include <arpa/inet.h>
50 #include <sys/param.h>
64 # define _(S) dgettext(PACKAGE, S)
74 extern char **environ;
75 #if defined(__GLIBC__) && __GLIBC__ < 2
76 int 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"
102 #include "workflow.h"
103 #include "file_obj.h"
104 #include "libreport_types.h"
105 #include "reporters.h"
111 char *libreport_trim_all_whitespace(
const char *str);
112 char *libreport_shorten_string_to_length(
const char *str,
unsigned length);
113 char *libreport_strtrimch(
char *str,
int ch);
114 char *libreport_strremovech(
char *str,
int ch);
115 char *libreport_append_to_malloced_string(
char *mstr,
const char *append);
116 char *libreport_skip_blank(
const char *s);
117 char *libreport_skip_whitespace(
const char *s);
118 char *libreport_skip_non_whitespace(
const char *s);
120 void libreport_overlapping_strcpy(
char *dst,
const char *src);
126 char *libreport_concat_path_basename(
const char *path,
const char *filename);
131 bool libreport_str_is_correct_filename(
const char *str);
134 char *libreport_xmalloc_fgets(FILE *file);
136 char *libreport_xmalloc_fgetline(FILE *file);
138 char *libreport_xmalloc_fopen_fgetline_fclose(
const char *filename);
142 COPYFD_SPARSE = 1 << 0,
143 } libreport_copyfd_flags;
161 off_t libreport_copyfd_ext_at(
int src,
int dir_fd,
const char *name,
int mode,
162 uid_t uid, gid_t gid,
int open_flags,
int copy_flags, off_t size);
165 off_t libreport_copyfd_eof(
int src_fd,
int dst_fd,
int flags);
166 off_t libreport_copyfd_size(
int src_fd,
int dst_fd, off_t size,
int flags);
167 void libreport_copyfd_exact_size(
int src_fd,
int dst_fd, off_t size);
168 off_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);
169 off_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);
170 #define libreport_copy_file_ext(src_name, dst_name, mode, uid, gid, src_flags, dst_flags) \
171 libreport_copy_file_ext_at(src_name, AT_FDCWD, dst_name, mode, uid, gid, src_flags, dst_flags)
172 off_t libreport_copy_file(
const char *src_name,
const char *dst_name,
int mode);
173 off_t libreport_copy_file_at(
const char *src_name,
int dir_fd,
const char *name,
int mode);
174 int libreport_copy_file_recursive(
const char *source,
const char *dest);
176 int libreport_decompress_fd(
int fdi,
int fdo);
177 int libreport_decompress_file(
const char *path_in,
const char *path_out, mode_t mode_out);
178 int libreport_decompress_file_ext_at(
const char *path_in,
int dir_fd,
const char *path_out,
179 mode_t mode_out, uid_t uid, gid_t gid,
int src_flags,
int dst_flags);
183 void libreport_xread(
int fd,
void *buf,
size_t count);
184 ssize_t libreport_safe_read(
int fd,
void *buf,
size_t count);
185 ssize_t libreport_safe_write(
int fd,
const void *buf,
size_t count);
186 ssize_t libreport_full_read(
int fd,
void *buf,
size_t count);
187 ssize_t libreport_full_write(
int fd,
const void *buf,
size_t count);
188 ssize_t libreport_full_write_str(
int fd,
const char *buf);
189 void *libreport_xmalloc_read(
int fd,
size_t *maxsz_p);
190 void *libreport_xmalloc_open_read_close(
const char *filename,
size_t *maxsz_p);
191 void *libreport_xmalloc_xopen_read_close(
const char *filename,
size_t *maxsz_p);
192 char *libreport_malloc_readlink(
const char *linkname);
193 char *libreport_malloc_readlinkat(
int dir_fd,
const char *linkname);
197 char *libreport_encode_base64(
const void *src,
int length);
203 char *libreport_sanitize_utf8(
const char *src, uint32_t control_chars_to_sanitize);
205 SANITIZE_ALL = 0xffffffff,
206 SANITIZE_TAB = (1 << 9),
207 SANITIZE_LF = (1 << 10),
208 SANITIZE_CR = (1 << 13),
216 pid_t libreport_safe_waitpid(pid_t pid,
int *wstat,
int options);
221 EXECFLG_INPUT = 1 << 0,
224 EXECFLG_OUTPUT = 1 << 1,
226 EXECFLG_INPUT_NUL = 1 << 2,
228 EXECFLG_OUTPUT_NUL = 1 << 3,
230 EXECFLG_ERR2OUT = 1 << 4,
232 EXECFLG_ERR_NUL = 1 << 5,
234 EXECFLG_QUIET = 1 << 6,
235 EXECFLG_SETGUID = 1 << 7,
236 EXECFLG_SETSID = 1 << 8,
237 EXECFLG_SETPGID = 1 << 9,
245 pid_t libreport_fork_execv_on_steroids(
int flags,
253 char *libreport_run_in_shell_and_save_output(
int flags,
260 bool libreport_is_in_string_list(
const char *name,
const char *
const *v);
262 int libreport_index_of_string_in_list(
const char *name,
const char *
const *v);
264 bool libreport_is_in_comma_separated_list(
const char *value,
const char *list);
265 bool libreport_is_in_comma_separated_list_of_glob_patterns(
const char *value,
const char *list);
269 void libreport_glib_init(
void);
274 void libreport_list_free_with_free(GList *list);
276 double libreport_get_dirsize(
const char *pPath);
277 double libreport_get_dirsize_find_largest_dir(
280 const char *excluded,
284 int libreport_ndelay_on(
int fd);
285 int libreport_ndelay_off(
int fd);
286 int libreport_close_on_exec_on(
int fd);
288 char *libreport_xstrdup_between(
const char *s,
const char *open,
const char *close);
290 int libreport_xdup(
int from);
291 void libreport_xdup2(
int from,
int to);
292 void libreport_xmove_fd(
int from,
int to);
294 void libreport_xwrite(
int fd,
const void *buf,
size_t count);
295 void libreport_xwrite_str(
int fd,
const char *str);
297 off_t libreport_xlseek(
int fd, off_t offset,
int whence);
299 char *libreport_xvasprintf(
const char *format, va_list p);
311 void libreport_safe_unsetenv(
const char *var_val);
313 int libreport_xsocket(
int domain,
int type,
int protocol);
314 void libreport_xbind(
int sockfd,
struct sockaddr *my_addr, socklen_t addrlen);
315 void libreport_xlisten(
int s,
int backlog);
316 ssize_t libreport_xsendto(
int s,
const void *buf,
size_t len,
317 const struct sockaddr *to, socklen_t tolen);
319 off_t libreport_fstat_st_size_or_die(
int fd);
320 off_t libreport_stat_st_size_or_die(
const char *filename);
322 int libreport_xopen3(
const char *pathname,
int flags,
int mode);
323 void libreport_xunlinkat(
int dir_fd,
const char *pathname,
int flags);
331 int libreport_is_regular_file(
struct dirent *dent,
const char *dirname);
332 int libreport_is_regular_file_at(
struct dirent *dent,
int dir_fd);
334 bool libreport_dot_or_dotdot(
const char *filename);
335 char *libreport_last_char_is(
const char *s,
int c);
337 bool libreport_string_to_bool(
const char *s);
339 void libreport_xseteuid(uid_t euid);
340 void libreport_xsetegid(gid_t egid);
341 void libreport_xsetreuid(uid_t ruid, uid_t euid);
342 void libreport_xsetregid(gid_t rgid, gid_t egid);
344 FILE *libreport_xfdopen(
int fd,
const char *mode);
347 char *libreport_bin2hex(
char *dst,
const char *str,
int count);
349 char* libreport_hex2bin(
char *dst,
const char *str,
int count);
354 LOGMODE_STDIO = (1 << 0),
355 LOGMODE_SYSLOG = (1 << 1),
356 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
357 LOGMODE_CUSTOM = (1 << 2),
358 LOGMODE_JOURNAL = (1 << 3),
361 enum libreport_diemode {
366 extern void (*libreport_g_custom_logger)(
const char*);
367 extern const char *libreport_msg_prefix;
368 extern const char *libreport_msg_eol;
369 extern int libreport_logmode;
370 extern int libreport_xfunc_error_retval;
373 #define EXIT_CANCEL_BY_USER 69
374 #define EXIT_STOP_EVENT_RUN 70
376 void libreport_set_xfunc_error_retval(
int retval);
378 void libreport_set_xfunc_diemode(
enum libreport_diemode mode);
381 extern int libreport_g_verbose;
383 #define VERB1 if (libreport_g_verbose >= 1)
385 #define VERB2 if (libreport_g_verbose >= 2)
387 #define VERB3 if (libreport_g_verbose >= 3)
390 void libreport_xfunc_die(
void) NORETURN;
392 void libreport_die_out_of_memory(
void) NORETURN;
396 #define log_warning(...) log_standard(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
397 #define log_debug(...) log_standard(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
398 #define log_info(...) log_standard(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
399 #define log_notice(...) log_standard(LOG_NOTICE, __FILE__, __LINE__, __func__, __VA_ARGS__)
400 #define log_warning(...) log_standard(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
401 #define log_error(...) log_standard(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
404 #define log_parser(...) if(0) log_debug(__VA_ARGS__)
406 #define log_standard(level, file, line, func, ...) log_wrapper(level, __FILE__, __LINE__, __func__, false, false, __VA_ARGS__)
409 #define log_error_and_die(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, false,__VA_ARGS__)
410 #define log_perror(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, false, __VA_ARGS__)
411 #define log_perror_and_die(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, false, __VA_ARGS__)
413 #define error_msg(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
414 #define perror_msg(...) log_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
415 #define warn_msg(...) log_wrapper(LOG_WARNING, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
416 #define pwarn_msg(...) log_wrapper(LOG_WARNING, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
417 #define notice_msg(...) log_wrapper(LOG_NOTICE, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
418 #define pnotice_msg(...) log_wrapper(LOG_NOTICE, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
419 #define error_msg_and_die(...) log_and_die_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, false, true, __VA_ARGS__)
420 #define perror_msg_and_die(...) log_and_die_wrapper(LOG_ERR, __FILE__, __LINE__, __func__, true, true, __VA_ARGS__)
423 void log_wrapper(
int level,
428 bool use_custom_logger,
429 const char *format, ...) __attribute__ ((format (printf, 7,8)));
431 void log_and_die_wrapper(
int level,
436 bool use_custom_logger,
437 const
char *format, ...) __attribute__ ((noreturn, format (printf, 7,8)));
444 GString *libreport_strbuf_append_strfv(GString *strbuf,
445 const
char *format, va_list p);
452 GString *libreport_strbuf_prepend_strf(GString *strbuf,
453 const
char *format, ...);
459 GString *libreport_strbuf_prepend_strfv(GString *strbuf,
460 const
char *format, va_list p);
467 int libreport_open_proc_pid_dir(pid_t pid);
468 char *libreport_get_cmdline_at(pid_t pid);
469 char *libreport_get_cmdline(pid_t pid);
470 char *libreport_get_environ_at(pid_t pid);
471 char *libreport_get_environ(pid_t pid);
472 char *libreport_get_executable_at(pid_t pid);
473 char *libreport_get_executable(pid_t pid);
474 char *libreport_get_cwd_at(pid_t pid);
475 char *libreport_get_cwd(pid_t pid);
476 char *libreport_get_rootdir_at(pid_t pid);
477 char *libreport_get_rootdir(pid_t pid);
479 int libreport_get_fsuid(const
char *proc_pid_status);
480 int libreport_get_fsgid(const
char *proc_pid_status);
481 int libreport_dump_fd_info_at(
int pid_proc_fd, FILE *dest);
482 int libreport_dump_fd_info_ext(const
char *dest_filename, const
char *proc_pid_fd_path, uid_t uid, gid_t gid);
483 int libreport_dump_fd_info(const
char *dest_filename, const
char *proc_pid_fd_path);
484 int libreport_get_env_variable_ext(
int fd,
char delim, const
char *name,
char **value);
485 int libreport_get_env_variable(pid_t pid, const
char *name,
char **value);
487 #define PROC_NS_UNSUPPORTED ((ino_t)-1)
488 #define PROC_NS_ID_CGROUP 0
489 #define PROC_NS_ID_IPC 1
490 #define PROC_NS_ID_MNT 2
491 #define PROC_NS_ID_NET 3
492 #define PROC_NS_ID_PID 4
493 #define PROC_NS_ID_TIME 6
494 #define PROC_NS_ID_USER 8
495 #define PROC_NS_ID_UTS 9
496 static const char * libreport_proc_namespaces[] = {
510 ino_t nsi_ids[ARRAY_SIZE(libreport_proc_namespaces)];
513 int libreport_get_ns_ids_at(
int pid_proc_fd,
struct ns_ids *ids);
514 int libreport_get_ns_ids(pid_t pid,
struct ns_ids *ids);
519 int libreport_process_has_own_root_at(
int proc_pid_fd);
520 int libreport_process_has_own_root(pid_t pid);
522 int libreport_get_pid_of_container_at(
int pid_proc_fd, pid_t *init_pid);
523 int libreport_get_pid_of_container(pid_t pid, pid_t *init_pid);
524 int libreport_dump_namespace_diff_at(
int base_pid_proc_fd,
int tested_pid_proc_fd, FILE *dest);
525 int libreport_dump_namespace_diff_ext(
const char *dest_filename, pid_t base_pid, pid_t tested_pid, uid_t uid, gid_t gid);
526 int libreport_dump_namespace_diff(
const char *dest_filename, pid_t base_pid, pid_t tested_pid);
530 MOUNTINFO_INDEX_MOUNT_ID,
531 MOUNTINFO_INDEX_PARENT_ID,
532 MOUNTINFO_INDEX_MAJOR_MINOR,
533 MOUNTINFO_INDEX_ROOT,
534 MOUNTINFO_INDEX_MOUNT_POINT,
535 MOUNTINFO_INDEX_MOUNT_OPTIONS,
536 MOUNTINFO_INDEX_OPTIONAL_FIELDS,
537 MOUNTINFO_INDEX_FS_TYPE,
538 MOUNTINFO_INDEX_MOUNT_SOURCE,
539 MOUNTINFO_INDEX_SUPER_OPITONS,
540 _MOUNTINFO_INDEX_MAX,
543 #define MOUNTINFO_ROOT(val) (val.mntnf_items[MOUNTINFO_INDEX_ROOT])
544 #define MOUNTINFO_MOUNT_POINT(val) (val.mntnf_items[MOUNTINFO_INDEX_MOUNT_POINT])
545 #define MOUNTINFO_MOUNT_SOURCE(val) (val.mntnf_items[MOUNTINFO_INDEX_MOUNT_SOURCE])
554 char *mntnf_items[_MOUNTINFO_INDEX_MAX];
556 void libreport_mountinfo_destroy(
struct mountinfo *mntnf);
557 int libreport_get_mountinfo_for_mount_point(FILE *fin,
struct mountinfo *mntnf,
const char *mnt_point);
562 char *libreport_iso_date_string(
const time_t *pt);
563 #define LIBREPORT_ISO_DATE_STRING_SAMPLE "YYYY-MM-DD-hh:mm:ss"
564 #define LIBREPORT_ISO_DATE_STRING_FORMAT "%Y-%m-%d-%H:%M:%S"
573 int libreport_iso_date_string_parse(
const char *date, time_t *pt);
576 MAKEDESC_SHOW_FILES = (1 << 0),
577 MAKEDESC_SHOW_MULTILINE = (1 << 1),
578 MAKEDESC_SHOW_ONLY_LIST = (1 << 2),
579 MAKEDESC_WHITELIST = (1 << 3),
581 MAKEDESC_SHOW_URLS = (1 << 4),
583 char *libreport_make_description(problem_data_t *problem_data,
char **names_to_skip,
unsigned max_text_size,
unsigned desc_flags);
584 char *libreport_make_description_logger(problem_data_t *problem_data,
unsigned max_text_size);
587 #define OSINFO_ID "ID"
588 #define OSINFO_NAME "NAME"
589 #define OSINFO_VERSION_ID "VERSION_ID"
590 #define OSINFO_PRETTY_NAME "PRETTY_NAME"
601 void libreport_parse_osinfo(
const char *osinfo_bytes, GHashTable *osinfo);
617 void libreport_parse_osinfo_for_bz(GHashTable *osinfo,
char **product,
char **version);
630 void libreport_parse_osinfo_for_bug_url(GHashTable *osinfo,
char** url);
646 void libreport_parse_osinfo_for_rhts(GHashTable *osinfo,
char **product,
char **version);
648 void libreport_parse_release_for_bz(
const char *pRelease,
char **product,
char **version);
649 void libreport_parse_release_for_rhts(
const char *pRelease,
char **product,
char **version);
665 bool libreport_load_conf_file(
const char *pPath, GHashTable *settings,
bool skipKeysWithoutValue);
666 bool libreport_load_plugin_conf_file(
const char *name, GHashTable *settings,
bool skipKeysWithoutValue);
668 const char *libreport_get_user_conf_base_dir(
void);
670 bool libreport_load_conf_file_from_dirs(
const char *base_name,
const char *
const *directories, GHashTable *settings,
bool skipKeysWithoutValue);
673 CONF_DIR_FLAG_NONE = 0,
674 CONF_DIR_FLAG_OPTIONAL = 1,
677 bool libreport_load_conf_file_from_dirs_ext(
const char *base_name,
const char *
const *directories,
678 const int * dir_flags, GHashTable *settings,
679 bool skipKeysWithoutValue);
681 bool libreport_save_conf_file(
const char *path, GHashTable *settings);
682 bool libreport_save_plugin_conf_file(
const char *name, GHashTable *settings);
684 bool libreport_save_app_conf_file(
const char* application_name, GHashTable *settings);
685 bool libreport_load_app_conf_file(
const char *application_name, GHashTable *settings);
686 void libreport_set_app_user_setting(GHashTable *settings,
const char *name,
const char *value);
687 const char *libreport_get_app_user_setting(GHashTable *settings,
const char *name);
689 bool libreport_save_user_settings(
void);
690 bool libreport_load_user_settings(
const char *application_name);
691 void libreport_set_user_setting(
const char *name,
const char *value);
692 const char *libreport_get_user_setting(
const char *name);
697 GList *libreport_load_words_from_file(
const char *filename);
698 GList *libreport_get_file_list(
const char *path,
const char *ext);
699 void libreport_free_file_list(GList *filelist);
700 file_obj_t *libreport_new_file_obj(
const char* fullpath,
const char* filename);
702 GList *libreport_parse_delimited_list(
const char *
string,
const char *delimiter);
705 int delete_dump_dir_possibly_using_abrtd(
const char *dump_dir_name);
709 struct dump_dir *libreport_steal_directory(
const char *base_dir,
const char *dump_dir_name);
717 bool libreport_uid_in_group(uid_t uid, gid_t gid);
725 struct dump_dir *libreport_open_directory_for_writing(
726 const char *dump_dir_name,
727 bool (*ask_continue)(
const char *,
const char *));
743 #define CD_MAX_TEXT_SIZE (8*1024*1024)
749 #define CD_TEXT_ATT_SIZE_BZ (4*1024)
751 #define CD_TEXT_ATT_SIZE_LOGGER (CD_MAX_TEXT_SIZE)
755 #define FILENAME_TIME "time"
756 #define FILENAME_LAST_OCCURRENCE "last_occurrence"
757 #define FILENAME_REASON "reason"
758 #define FILENAME_UID "uid"
772 #define FILENAME_ANALYZER "analyzer"
773 #define FILENAME_TYPE "type"
774 #define FILENAME_EXECUTABLE "executable"
775 #define FILENAME_PID "pid"
776 #define FILENAME_TID "tid"
777 #define FILENAME_GLOBAL_PID "global_pid"
778 #define FILENAME_PWD "pwd"
779 #define FILENAME_ROOTDIR "rootdir"
780 #define FILENAME_BINARY "binary"
781 #define FILENAME_CMDLINE "cmdline"
782 #define FILENAME_COREDUMP "coredump"
783 #define FILENAME_CGROUP "cgroup"
784 #define FILENAME_BACKTRACE "backtrace"
785 #define FILENAME_MAPS "maps"
786 #define FILENAME_SMAPS "smaps"
787 #define FILENAME_PROC_PID_STATUS "proc_pid_status"
788 #define FILENAME_ENVIRON "environ"
789 #define FILENAME_LIMITS "limits"
790 #define FILENAME_OPEN_FDS "open_fds"
791 #define FILENAME_MOUNTINFO "mountinfo"
792 #define FILENAME_NAMESPACES "namespaces"
793 #define FILENAME_CPUINFO "cpuinfo"
798 #define FILENAME_DUPHASH "duphash"
802 #define FILENAME_CRASH_FUNCTION "crash_function"
803 #define FILENAME_ARCHITECTURE "architecture"
804 #define FILENAME_KERNEL "kernel"
811 #define FILENAME_OS_INFO "os_info"
812 #define FILENAME_OS_INFO_IN_ROOTDIR "os_info_in_rootdir"
814 #define FILENAME_OS_RELEASE "os_release"
815 #define FILENAME_OS_RELEASE_IN_ROOTDIR "os_release_in_rootdir"
817 #define FILENAME_PACKAGE "package"
818 #define FILENAME_COMPONENT "component"
819 #define FILENAME_COMMENT "comment"
820 #define FILENAME_RATING "backtrace_rating"
821 #define FILENAME_HOSTNAME "hostname"
823 #define FILENAME_REMOTE "remote"
824 #define FILENAME_TAINTED "kernel_tainted"
825 #define FILENAME_TAINTED_SHORT "kernel_tainted_short"
826 #define FILENAME_TAINTED_LONG "kernel_tainted_long"
827 #define FILENAME_VMCORE "vmcore"
828 #define FILENAME_KERNEL_LOG "kernel_log"
831 #define FILENAME_DESCRIPTION "description"
837 #define FILENAME_UUID "uuid"
839 #define FILENAME_COUNT "count"
846 #define FILENAME_REPORTED_TO "reported_to"
847 #define FILENAME_EVENT_LOG "event_log"
853 #define FILENAME_NOT_REPORTABLE "not-reportable"
854 #define FILENAME_CORE_BACKTRACE "core_backtrace"
855 #define FILENAME_REMOTE_RESULT "remote_result"
856 #define FILENAME_PKG_EPOCH "pkg_epoch"
857 #define FILENAME_PKG_NAME "pkg_name"
858 #define FILENAME_PKG_VERSION "pkg_version"
859 #define FILENAME_PKG_RELEASE "pkg_release"
860 #define FILENAME_PKG_ARCH "pkg_arch"
863 #define FILENAME_PKG_VENDOR "pkg_vendor"
865 #define FILENAME_PKG_FINGERPRINT "pkg_fingerprint"
867 #define FILENAME_USERNAME "username"
868 #define FILENAME_ABRT_VERSION "abrt_version"
869 #define FILENAME_EXPLOITABLE "exploitable"
872 #define FILENAME_REPRODUCIBLE "reproducible"
873 #define FILENAME_REPRODUCER "reproducer"
877 #define FILENAME_KICKSTART_CFG "ks.cfg"
878 #define FILENAME_ANACONDA_TB "anaconda-tb"
882 #define FILENAME_CONTAINER "container"
883 #define FILENAME_CONTAINER_ID "container_id"
884 #define FILENAME_CONTAINER_UUID "container_uuid"
885 #define FILENAME_CONTAINER_IMAGE "container_image"
886 #define FILENAME_CONTAINER_CMDLINE "container_cmdline"
888 #define FILENAME_CONTAINER_ROOTFS "container_rootfs"
889 #define FILENAME_DOCKER_INSPECT "docker_inspect"
894 #define FILENAME_EXCEPTION_TYPE "exception_type"
897 #define CD_DUMPDIR "Directory"
899 gint libreport_cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename);
910 EVENT_LOG_HIGH_WATERMARK = 30 * 1024,
911 EVENT_LOG_LOW_WATERMARK = 20 * 1024,
914 void libreport_log_problem_data(problem_data_t *problem_data,
const char *pfx);
916 extern int g_libreport_inited;
917 void libreport_init(
void);
919 #define INITIALIZE_LIBREPORT() \
922 if (!g_libreport_inited) \
924 g_libreport_inited = 1; \
930 const char *abrt_init(
char **argv);
931 void libreport_export_abrt_envvars(
int pfx);
932 extern const char *libreport_g_progname;
934 enum parse_opt_type {
945 enum parse_opt_type type;
947 const char *long_name;
960 #define OPT_END() { OPTION_END, 0, NULL, NULL, NULL, NULL }
961 #define OPT_GROUP(h) { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }
962 #define OPT_BOOL( s, l, v, h) { OPTION_BOOL , (s), (l), (v), NULL , (h) }
963 #define OPT_INTEGER( s, l, v, h) { OPTION_INTEGER , (s), (l), (v), "NUM", (h) }
964 #define OPT_STRING( s, l, v, a, h) { OPTION_STRING , (s), (l), (v), (a) , (h) }
965 #define OPT_OPTSTRING(s, l, v, a, h) { OPTION_OPTSTRING, (s), (l), (v), (a) , (h) }
966 #define OPT_LIST( s, l, v, a, h) { OPTION_LIST , (s), (l), (v), (a) , (h) }
968 #define OPT__VERBOSE(v) OPT_BOOL('v', "verbose", (v), _("Be verbose"))
969 #define OPT__DUMP_DIR(v) OPT_STRING('d', "problem-dir", (v), "DIR", _("Problem directory"))
971 unsigned libreport_parse_opts(
int argc,
char **argv,
const struct options *opt,
974 void libreport_show_usage_and_die(
const char *usage,
const struct options *opt) NORETURN;
979 struct abrt_post_state;
1000 int libreport_uri_userinfo_remove(
const char *uri,
char **result,
char **scheme,
char **hostname,
char **username,
char **password,
char **location);