summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/daemon/MiddleWare.cpp5
-rw-r--r--src/gtk-helpers/Makefile.am2
-rw-r--r--src/gtk-helpers/abrt-keyring.c137
-rw-r--r--src/gtk-helpers/event_config_dialog.c241
-rw-r--r--src/gtk-helpers/libreport-gtk.h18
-rw-r--r--src/gui-gtk/Makefile.am4
-rw-r--r--src/gui-gtk/abrt-gtk.c20
-rw-r--r--src/gui-gtk/abrt-gtk.h18
-rw-r--r--src/gui-gtk/main.c18
-rw-r--r--src/gui-wizard-gtk/Makefile.am2
-rw-r--r--src/gui-wizard-gtk/main.c22
-rw-r--r--src/gui-wizard-gtk/wizard.c54
-rw-r--r--src/gui-wizard-gtk/wizard.glade70
-rw-r--r--src/gui-wizard-gtk/wizard.h18
-rw-r--r--src/include/report/dump_dir.h3
-rw-r--r--src/lib/abrt_dbus.c2
-rw-r--r--src/lib/dump_dir.c49
-rw-r--r--src/lib/event_config.c20
-rw-r--r--src/lib/event_xml_parser.c20
-rw-r--r--src/lib/steal_directory.c18
-rw-r--r--src/plugins/abrt-action-install-debuginfo.c18
-rw-r--r--src/plugins/abrt-action-kerneloops.c2
-rw-r--r--src/plugins/abrt-action-mailx.c2
23 files changed, 565 insertions, 198 deletions
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index 84400361..6ee0d0c0 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -532,6 +532,11 @@ mw_result_t LoadDebugDump(const char *dump_dir_name, crash_data_t **crash_data)
res = MW_ERROR;
goto ret;
}
+
+ /* Reset mode/uig/gid to correct values for all files created by event run */
+ dd_sanitize_mode_and_owner(dd);
+
+ /* Update count */
char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY_ENOENT);
unsigned long count = strtoul(count_str, NULL, 10);
count++;
diff --git a/src/gtk-helpers/Makefile.am b/src/gtk-helpers/Makefile.am
index de35d39b..90c9be7f 100644
--- a/src/gtk-helpers/Makefile.am
+++ b/src/gtk-helpers/Makefile.am
@@ -20,4 +20,4 @@ libreportgtk_la_LDFLAGS = \
libreportgtk_la_LIBADD = \
$(GTK_LIBS) \
$(GLIB_LIBS) \
- $(GNOME_KEYRING_CFLAGS)
+ $(GNOME_KEYRING_LIBS)
diff --git a/src/gtk-helpers/abrt-keyring.c b/src/gtk-helpers/abrt-keyring.c
index 50bfa7e3..c4fbffae 100644
--- a/src/gtk-helpers/abrt-keyring.c
+++ b/src/gtk-helpers/abrt-keyring.c
@@ -1,28 +1,48 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <gnome-keyring.h>
-#include <string.h>
-#include <stdlib.h>
#include "abrtlib.h"
-static char *keyring;
+static char *keyring_name;
+static bool got_keyring = 0;
static guint32 search_item_id(const char *event_name)
{
GnomeKeyringAttributeList *attrs = gnome_keyring_attribute_list_new();
- GList *found;
- //let's hope 0 is not valid item_id
- guint32 item_id = 0;
+ GList *found = NULL;
gnome_keyring_attribute_list_append_string(attrs, "libreportEventConfig", event_name);
GnomeKeyringResult result = gnome_keyring_find_items_sync(
GNOME_KEYRING_ITEM_GENERIC_SECRET,
attrs,
&found);
- if(result != GNOME_KEYRING_RESULT_OK)
- return item_id;
- if(found)
- {
+ gnome_keyring_attribute_list_free(attrs);
+
+ //let's hope 0 is not valid item_id
+ guint32 item_id = 0;
+ if (result != GNOME_KEYRING_RESULT_OK)
+ goto ret;
+ if (found)
item_id = ((GnomeKeyringFound *)found->data)->item_id;
+ ret:
+ if (found)
gnome_keyring_found_list_free(found);
- }
+ VERB2 log("keyring has %sconfiguration for event '%s'", (item_id != 0) ? "" : "no ", event_name);
return item_id;
}
@@ -30,28 +50,27 @@ void abrt_keyring_save_settings(const char *event_name)
{
GList *l;
GnomeKeyringAttributeList *attrs = gnome_keyring_attribute_list_new();
- guint32 item_id;
event_config_t *ec = get_event_config(event_name);
/* add string id which we use to search for items */
gnome_keyring_attribute_list_append_string(attrs, "libreportEventConfig", event_name);
- for(l = g_list_first(ec->options); l != NULL; l = g_list_next(l))
+ for (l = g_list_first(ec->options); l != NULL; l = g_list_next(l))
{
event_option_t *op = (event_option_t *)l->data;
gnome_keyring_attribute_list_append_string(attrs, op->name, op->value);
}
GnomeKeyringResult result;
- item_id = search_item_id(event_name);
- if(item_id)
+ guint32 item_id = search_item_id(event_name);
+ if (item_id)
{
- VERB2 log("updating item with id: %i", item_id);
/* found existing item, so just update the values */
- result = gnome_keyring_item_set_attributes_sync(keyring, item_id, attrs);
+ result = gnome_keyring_item_set_attributes_sync(keyring_name, item_id, attrs);
+ VERB2 log("updated item with id: %i", item_id);
}
else
{
/* did't find existing item, so create a new one */
- result = gnome_keyring_item_create_sync(keyring,
+ result = gnome_keyring_item_create_sync(keyring_name,
GNOME_KEYRING_ITEM_GENERIC_SECRET, /* type */
event_name, /* display name */
attrs, /* attributes */
@@ -60,71 +79,79 @@ void abrt_keyring_save_settings(const char *event_name)
&item_id);
VERB2 log("created new item with id: %i", item_id);
}
+ gnome_keyring_attribute_list_free(attrs);
- if(result != GNOME_KEYRING_RESULT_OK)
+ if (result != GNOME_KEYRING_RESULT_OK)
{
- VERB2 log("error occured, settings is not saved!");
+ error_msg("Error saving event '%s' configuration to keyring", event_name);
return;
}
- VERB2 log("saved");
+ VERB2 log("saved event '%s' configuration to keyring", event_name);
}
static void abrt_keyring_load_settings(const char *event_name, event_config_t *ec)
{
- GnomeKeyringAttributeList *attrs = gnome_keyring_attribute_list_new();
guint item_id = search_item_id(event_name);
- if(!item_id)
+ if (!item_id)
return;
+ GnomeKeyringAttributeList *attrs = NULL;
GnomeKeyringResult result = gnome_keyring_item_get_attributes_sync(
- keyring,
+ keyring_name,
item_id,
&attrs);
- VERB2 log("num attrs %i", attrs->len);
- if(result != GNOME_KEYRING_RESULT_OK)
- return;
- guint index;
-
- for(index = 0; index < attrs->len; index++)
+ if (result == GNOME_KEYRING_RESULT_OK && attrs)
{
- char *name = g_array_index(attrs, GnomeKeyringAttribute, index).name;
-VERB2 log("load %s", name);
- event_option_t *option = get_event_option_from_list(name, ec->options);
- if(option)
- option->value = g_array_index(attrs, GnomeKeyringAttribute, index).value.string;
-VERB2 log("loaded %s", name);
- //VERB2 log("load %s", g_array_index(attrs, GnomeKeyringAttribute, index).value);
-
+ VERB3 log("num attrs %i", attrs->len);
+ guint index;
+ for (index = 0; index < attrs->len; index++)
+ {
+ char *name = g_array_index(attrs, GnomeKeyringAttribute, index).name;
+ VERB2 log("keyring has name '%s'", name);
+ event_option_t *option = get_event_option_from_list(name, ec->options);
+ if (option)
+ {
+ free(option->value);
+ option->value = xstrdup(g_array_index(attrs, GnomeKeyringAttribute, index).value.string);
+ VERB2 log("added or replaced in event config:'%s=%s'", name, option->value);
+ }
+ }
}
+ if (attrs)
+ gnome_keyring_attribute_list_free(attrs);
}
static void init_keyring()
{
- //called again?
- if(keyring)
+ /* Called again? */
+ if (got_keyring)
+ return;
+
+ if (!gnome_keyring_is_available())
+ {
+ error_msg("Cannot connect to Gnome keyring daemon");
return;
- if(!gnome_keyring_is_available())
+ }
+
+ GnomeKeyringResult result = gnome_keyring_get_default_keyring_sync(&keyring_name);
+ if (result != GNOME_KEYRING_RESULT_OK)
{
- VERB2 log("Cannot connect to the Gnome Keyring daemon.");
+ error_msg("Can't get default keyring (result:%d)", result);
return;
}
- GnomeKeyringResult result = gnome_keyring_get_default_keyring_sync(&keyring);
- if(result != GNOME_KEYRING_RESULT_OK || keyring == NULL)
- VERB2 log("can't get the default kerying");
+
+ got_keyring = 1;
/*
- The default keyring might not be set - in that case result = OK, but the
- keyring = NULL
- use gnome_keyring_list_keyring_names () to list all and pick the first one?
- */
- VERB2 log("%s", keyring);
+ * Note: The default keyring name can be NULL. It is a valid name.
+ */
+ VERB2 log("keyring:'%s'", keyring_name);
}
-void load_event_config(gpointer key, gpointer value, gpointer user_data)
+static void load_event_config(gpointer key, gpointer value, gpointer user_data)
{
char* event_name = (char*)key;
event_config_t *ec = (event_config_t *)value;
-VERB2 log("from keyring loading: %s\n", event_name);
+ VERB2 log("loading event '%s' configuration from keyring", event_name);
abrt_keyring_load_settings(event_name, ec);
-
}
/*
@@ -133,7 +160,7 @@ VERB2 log("from keyring loading: %s\n", event_name);
void load_event_config_data_from_keyring()
{
init_keyring();
- if(!keyring)
+ if (!got_keyring)
return;
g_hash_table_foreach(g_event_config_list, &load_event_config, NULL);
-} \ No newline at end of file
+}
diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c
index cdfcb844..f2908a5e 100644
--- a/src/gtk-helpers/event_config_dialog.c
+++ b/src/gtk-helpers/event_config_dialog.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include "abrtlib.h"
#include <gtk/gtk.h>
#include "libreport-gtk.h"
@@ -23,20 +41,7 @@ typedef struct
static void show_event_config_dialog(const char *event_name);
-static void show_error_message(const char* message, GtkWindow *parent)
-{
- GtkWidget *dialog = gtk_message_dialog_new(parent,
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- message
- );
- gtk_window_set_icon_name(GTK_WINDOW(dialog), "abrt");
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-}
-
-GtkWidget *gtk_label_new_justify_left(const gchar *label_str)
+static GtkWidget *gtk_label_new_justify_left(const gchar *label_str)
{
GtkWidget *label = gtk_label_new(label_str);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
@@ -64,12 +69,12 @@ static void add_option_to_dialog(event_option_t *option)
GtkWidget *option_input;
GtkWidget *option_hbox = gtk_hbox_new(FALSE, 0);
char *option_label;
- if(option->label != NULL)
+ if (option->label != NULL)
option_label = option->label;
else
option_label = option->name;
- switch(option->type)
+ switch (option->type)
{
case OPTION_TYPE_TEXT:
case OPTION_TYPE_NUMBER:
@@ -80,7 +85,7 @@ static void add_option_to_dialog(event_option_t *option)
GTK_FILL, GTK_FILL,
0,0);
option_input = gtk_entry_new();
- if(option->value != NULL)
+ if (option->value != NULL)
gtk_entry_set_text(GTK_ENTRY(option_input), option->value);
gtk_table_attach(GTK_TABLE(option_table), option_input,
1, 2,
@@ -96,7 +101,7 @@ static void add_option_to_dialog(event_option_t *option)
last_row, last_row+1,
GTK_FILL, GTK_FILL,
0,0);
- if(option->value != NULL)
+ if (option->value != NULL)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option_input),
(strcmp("yes",option->value)==0));
add_option_widget(option_input, option);
@@ -109,7 +114,7 @@ static void add_option_to_dialog(event_option_t *option)
GTK_FILL, GTK_FILL,
0,0);
option_input = gtk_entry_new();
- if(option->value != NULL)
+ if (option->value != NULL)
gtk_entry_set_text(GTK_ENTRY(option_input), option->value);
gtk_table_attach(GTK_TABLE(option_table), option_input,
1, 2,
@@ -129,7 +134,7 @@ static void add_option_to_dialog(event_option_t *option)
break;
default:
//option_input = gtk_label_new_justify_left("WTF?");
- g_print("unsupported option type\n");
+ log("unsupported option type");
}
last_row++;
@@ -170,17 +175,17 @@ static void on_configure_event_cb(GtkWidget *button, gpointer user_data)
{
GtkTreeView *events_tv = (GtkTreeView *)user_data;
char *event_name = get_event_name_from_row(events_tv);
- if(event_name != NULL)
+ if (event_name != NULL)
show_event_config_dialog(event_name);
- else
- show_error_message(_("Please select a plugin from the list to edit its options."), NULL);
+ //else
+ // error_msg(_("Please select a plugin from the list to edit its options."));
}
static void on_event_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
{
char *event_name = get_event_name_from_row(treeview);
event_config_t *ec = get_event_config(event_name);
- if(ec->options != NULL) //We need to have some options to show
+ if (ec->options != NULL) //We need to have some options to show
show_event_config_dialog(event_name);
}
@@ -196,7 +201,7 @@ static void add_event_to_liststore(gpointer key, gpointer value, gpointer user_d
GtkListStore *events_list_store = (GtkListStore *)user_data;
event_config_t *ec = (event_config_t *)value;
char *event_label = NULL;
- if(ec->screen_name != NULL && ec->description != NULL)
+ if (ec->screen_name != NULL && ec->description != NULL)
event_label = xasprintf("<b>%s</b>\n%s", ec->screen_name, ec->description);
else
//if event has no xml description
@@ -215,7 +220,7 @@ static void add_event_to_liststore(gpointer key, gpointer value, gpointer user_d
static void save_value_from_widget(gpointer data, gpointer user_data)
{
option_widget_t *ow = (option_widget_t *)data;
- switch(ow->option->type)
+ switch (ow->option->type)
{
case OPTION_TYPE_TEXT:
case OPTION_TYPE_NUMBER:
@@ -226,20 +231,20 @@ static void save_value_from_widget(gpointer data, gpointer user_data)
ow->option->value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ow->widget)) ? xstrdup("yes") : xstrdup("no");
break;
default:
- g_print("unsupported option type\n");
+ log("unsupported option type");
}
VERB1 log("saved: %s:%s", ow->option->name, ow->option->value);
}
static void dehydrate_config_dialog()
{
- if(option_widget_list != NULL)
+ if (option_widget_list != NULL)
g_list_foreach(option_widget_list, &save_value_from_widget, NULL);
}
static void show_event_config_dialog(const char *event_name)
{
- if(option_widget_list != NULL)
+ if (option_widget_list != NULL)
{
g_list_free(option_widget_list);
option_widget_list = NULL;
@@ -247,7 +252,7 @@ static void show_event_config_dialog(const char *event_name)
event_config_t *event = get_event_config(event_name);
char *title;
- if(event->screen_name != NULL)
+ if (event->screen_name != NULL)
title = event->screen_name;
else
title = _("Event Configuration");
@@ -261,7 +266,7 @@ static void show_event_config_dialog(const char *event_name)
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
NULL);
- if(parent_dialog != NULL)
+ if (parent_dialog != NULL)
{
gtk_window_set_icon_name(GTK_WINDOW(dialog),
gtk_window_get_icon_name(GTK_WINDOW(parent_dialog)));
@@ -274,104 +279,98 @@ static void show_event_config_dialog(const char *event_name)
gtk_box_pack_start(GTK_BOX(content), option_table, false, false, 20);
gtk_widget_show_all(option_table);
int result = gtk_dialog_run(GTK_DIALOG(dialog));
- if(result == GTK_RESPONSE_APPLY)
+ if (result == GTK_RESPONSE_APPLY)
{
dehydrate_config_dialog();
abrt_keyring_save_settings(event_name);
}
- else if(result == GTK_RESPONSE_CANCEL)
- g_print("cancel\n");
+ //else if (result == GTK_RESPONSE_CANCEL)
+ // log("log");
gtk_widget_destroy(GTK_WIDGET(dialog));
}
void show_events_list_dialog(GtkWindow *parent)
{
- /*remove this line if we want to reload the config
- *everytime we show the config dialog
- */
- if(g_event_config_list == NULL)
- {
- load_event_config_data();
- load_event_config_data_from_keyring();
- }
- if(g_event_config_list == NULL)
- {
- VERB1 log("can't load event's config\n");
- show_error_message(_("Can't load event descriptions"), parent);
- return;
- }
- parent_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(parent_dialog), _("Events"));
- gtk_window_set_default_size(GTK_WINDOW(parent_dialog), 450, 400);
- if(parent != NULL)
- {
- gtk_window_set_transient_for(GTK_WINDOW(parent_dialog), parent);
- // modal = parent window can't steal focus
- gtk_window_set_modal(GTK_WINDOW(parent_dialog), true);
- gtk_window_set_icon_name(GTK_WINDOW(parent_dialog),
- gtk_window_get_icon_name(parent));
- }
+ /*remove this line if we want to reload the config
+ *everytime we show the config dialog
+ */
+ if (g_event_config_list == NULL)
+ {
+ load_event_config_data();
+ load_event_config_data_from_keyring();
+ }
+ parent_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW(parent_dialog), _("Events"));
+ gtk_window_set_default_size(GTK_WINDOW(parent_dialog), 450, 400);
+ if (parent != NULL)
+ {
+ gtk_window_set_transient_for(GTK_WINDOW(parent_dialog), parent);
+ // modal = parent window can't steal focus
+ gtk_window_set_modal(GTK_WINDOW(parent_dialog), true);
+ gtk_window_set_icon_name(GTK_WINDOW(parent_dialog),
+ gtk_window_get_icon_name(parent));
+ }
- GtkWidget *main_vbox = gtk_vbox_new(0, 0);
- GtkWidget *events_scroll = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(events_scroll),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- /* event list treeview */
- GtkWidget *events_tv = gtk_tree_view_new();
- /* column with event name and description */
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
-
- /* add column to tree view */
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Event"),
- renderer,
- "markup",
- COLUMN_EVENT_UINAME,
- "background",
- COLUMN_EVENT_BG,
- NULL);
- gtk_tree_view_column_set_resizable(column, TRUE);
- g_object_set(G_OBJECT(renderer), "wrap-mode", PANGO_WRAP_WORD, NULL);
- g_object_set(G_OBJECT(renderer), "wrap-width", 440, NULL);
- gtk_tree_view_column_set_sort_column_id(column, COLUMN_EVENT_NAME);
- gtk_tree_view_append_column(GTK_TREE_VIEW(events_tv), column);
-
- /* Create data store for the list and attach it
- * COLUMN_EVENT_UINAME -> name+description
- * COLUMN_EVENT_NAME -> event name so we can retrieve it from the row
- */
- GtkListStore *events_list_store = gtk_list_store_new(NUM_COLUMNS,
- G_TYPE_STRING, /* Event name + description */
- G_TYPE_STRING, /* event name */
- G_TYPE_STRING);/* bg color */
- gtk_tree_view_set_model(GTK_TREE_VIEW(events_tv), GTK_TREE_MODEL(events_list_store));
-
- g_hash_table_foreach(g_event_config_list,
- &add_event_to_liststore,
- events_list_store);
-
- /* Double click/Enter handler */
- g_signal_connect(events_tv, "row-activated", G_CALLBACK(on_event_row_activated_cb), NULL);
-
- gtk_container_add(GTK_CONTAINER(events_scroll), events_tv);
-
- GtkWidget *configure_event_btn = gtk_button_new_with_mnemonic(_("Configure E_vent"));
- gtk_widget_set_sensitive(configure_event_btn, false);
- g_signal_connect(configure_event_btn, "clicked", G_CALLBACK(on_configure_event_cb), events_tv);
- g_signal_connect(events_tv, "cursor-changed", G_CALLBACK(on_event_row_changed_cb), configure_event_btn);
-
- GtkWidget *close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
- g_signal_connect(close_btn, "clicked", G_CALLBACK(on_close_event_list_cb), parent_dialog);
-
- GtkWidget *btnbox = gtk_hbutton_box_new();
- gtk_box_pack_end(GTK_BOX(btnbox), configure_event_btn, false, false, 0);
- gtk_box_pack_end(GTK_BOX(btnbox), close_btn, false, false, 0);
-
- gtk_box_pack_start(GTK_BOX(main_vbox), events_scroll, true, true, 10);
- gtk_box_pack_start(GTK_BOX(main_vbox), btnbox, false, false, 0);
- gtk_container_add(GTK_CONTAINER(parent_dialog), main_vbox);
-
- gtk_widget_show_all(parent_dialog);
+ GtkWidget *main_vbox = gtk_vbox_new(0, 0);
+ GtkWidget *events_scroll = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(events_scroll),
+ GTK_POLICY_NEVER,
+ GTK_POLICY_AUTOMATIC);
+ /* event list treeview */
+ GtkWidget *events_tv = gtk_tree_view_new();
+ /* column with event name and description */
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+
+ /* add column to tree view */
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Event"),
+ renderer,
+ "markup",
+ COLUMN_EVENT_UINAME,
+ "background",
+ COLUMN_EVENT_BG,
+ NULL);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ g_object_set(G_OBJECT(renderer), "wrap-mode", PANGO_WRAP_WORD, NULL);
+ g_object_set(G_OBJECT(renderer), "wrap-width", 440, NULL);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_EVENT_NAME);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(events_tv), column);
+
+ /* Create data store for the list and attach it
+ * COLUMN_EVENT_UINAME -> name+description
+ * COLUMN_EVENT_NAME -> event name so we can retrieve it from the row
+ */
+ GtkListStore *events_list_store = gtk_list_store_new(NUM_COLUMNS,
+ G_TYPE_STRING, /* Event name + description */
+ G_TYPE_STRING, /* event name */
+ G_TYPE_STRING);/* bg color */
+ gtk_tree_view_set_model(GTK_TREE_VIEW(events_tv), GTK_TREE_MODEL(events_list_store));
+
+ g_hash_table_foreach(g_event_config_list,
+ &add_event_to_liststore,
+ events_list_store);
+
+ /* Double click/Enter handler */
+ g_signal_connect(events_tv, "row-activated", G_CALLBACK(on_event_row_activated_cb), NULL);
+
+ gtk_container_add(GTK_CONTAINER(events_scroll), events_tv);
+
+ GtkWidget *configure_event_btn = gtk_button_new_with_mnemonic(_("Configure E_vent"));
+ gtk_widget_set_sensitive(configure_event_btn, false);
+ g_signal_connect(configure_event_btn, "clicked", G_CALLBACK(on_configure_event_cb), events_tv);
+ g_signal_connect(events_tv, "cursor-changed", G_CALLBACK(on_event_row_changed_cb), configure_event_btn);
+
+ GtkWidget *close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+ g_signal_connect(close_btn, "clicked", G_CALLBACK(on_close_event_list_cb), parent_dialog);
+
+ GtkWidget *btnbox = gtk_hbutton_box_new();
+ gtk_box_pack_end(GTK_BOX(btnbox), configure_event_btn, false, false, 0);
+ gtk_box_pack_end(GTK_BOX(btnbox), close_btn, false, false, 0);
+
+ gtk_box_pack_start(GTK_BOX(main_vbox), events_scroll, true, true, 10);
+ gtk_box_pack_start(GTK_BOX(main_vbox), btnbox, false, false, 0);
+ gtk_container_add(GTK_CONTAINER(parent_dialog), main_vbox);
+
+ gtk_widget_show_all(parent_dialog);
}
diff --git a/src/gtk-helpers/libreport-gtk.h b/src/gtk-helpers/libreport-gtk.h
index a916113e..e7cf4824 100644
--- a/src/gtk-helpers/libreport-gtk.h
+++ b/src/gtk-helpers/libreport-gtk.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
void show_events_list_dialog(GtkWindow *parent);
void abrt_keyring_save_settings(const char *event_name);
void load_event_config_data_from_keyring();
diff --git a/src/gui-gtk/Makefile.am b/src/gui-gtk/Makefile.am
index 978f9428..b5c6cd54 100644
--- a/src/gui-gtk/Makefile.am
+++ b/src/gui-gtk/Makefile.am
@@ -16,7 +16,6 @@ abrt_gui_CFLAGS = \
-DICON_DIR=\"${datadir}/abrt/icons/hicolor/48x48/status\" \
$(GTK_CFLAGS) \
$(DBUS_CFLAGS) \
- $(GNOME_KEYRING_CFLAGS) \
-D_GNU_SOURCE \
-Wall -Wwrite-strings -Werror
# -I/usr/include/glib-2.0
@@ -30,8 +29,7 @@ abrt_gui_LDADD = \
-lglib-2.0 \
-lgthread-2.0 \
$(GTK_LIBS) \
- $(DBUS_LIBS) \
- $(GNOME_KEYRING_LIBS)
+ $(DBUS_LIBS)
# $(LIBNOTIFY_LIBS)
#test_report_SOURCES = \
diff --git a/src/gui-gtk/abrt-gtk.c b/src/gui-gtk/abrt-gtk.c
index ea85b0b6..3405fc2d 100644
--- a/src/gui-gtk/abrt-gtk.c
+++ b/src/gui-gtk/abrt-gtk.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "abrtlib.h"
@@ -215,7 +233,7 @@ static void on_menu_about_cb(GtkMenuItem *menuitem, gpointer unused)
gtk_widget_hide(GTK_WIDGET(about_d));
}
-void show_events_list_dialog_cb(GtkMenuItem *menuitem, gpointer user_data)
+static void show_events_list_dialog_cb(GtkMenuItem *menuitem, gpointer user_data)
{
show_events_list_dialog(GTK_WINDOW(g_main_window));
}
diff --git a/src/gui-gtk/abrt-gtk.h b/src/gui-gtk/abrt-gtk.h
index d67ca6ce..5dccc991 100644
--- a/src/gui-gtk/abrt-gtk.h
+++ b/src/gui-gtk/abrt-gtk.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
GtkWidget *create_main_window(void);
void add_directory_to_dirlist(const char *dirname);
void sanitize_cursor(GtkTreePath *preferred_path);
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index d80256e9..3a8b4aa8 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <gtk/gtk.h>
#include "abrtlib.h"
#include "parse_options.h"
diff --git a/src/gui-wizard-gtk/Makefile.am b/src/gui-wizard-gtk/Makefile.am
index a44de58c..6be5a946 100644
--- a/src/gui-wizard-gtk/Makefile.am
+++ b/src/gui-wizard-gtk/Makefile.am
@@ -12,6 +12,7 @@ bug_reporting_wizard_SOURCES = \
bug_reporting_wizard_CFLAGS = \
-I$(srcdir)/../include/report -I$(srcdir)/../include \
-I$(srcdir)/../lib \
+ -I$(srcdir)/../gtk-helpers \
-DBIN_DIR=\"$(bindir)\" \
-DVAR_RUN=\"$(VAR_RUN)\" \
-DCONF_DIR=\"$(CONF_DIR)\" \
@@ -32,6 +33,7 @@ bug_reporting_wizard_CFLAGS = \
bug_reporting_wizard_LDADD = \
../lib/libreport.la \
../lib/libabrt_dbus.la \
+ ../gtk-helpers/libreportgtk.la \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(DBUS_LIBS)
diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c
index 23ff0699..8e00271a 100644
--- a/src/gui-wizard-gtk/main.c
+++ b/src/gui-wizard-gtk/main.c
@@ -1,7 +1,26 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <gtk/gtk.h>
#include "abrtlib.h"
#include "parse_options.h"
#include "wizard.h"
+#include "libreport-gtk.h"
#define PROGNAME "bug-reporting-wizard"
@@ -34,7 +53,8 @@ void reload_crash_data_from_dump_dir(void)
/* Load /etc/abrt/events/foo.{conf,xml} stuff */
load_event_config_data();
-//TODO: load overrides from keyring? Load ~/.abrt/events/foo.conf?
+ load_event_config_data_from_keyring();
+//TODO: Load ~/.abrt/events/foo.conf?
}
int main(int argc, char **argv)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index d0a9c080..9a642f59 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -1,7 +1,26 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <gtk/gtk.h>
#include "abrtlib.h"
#include "abrt_dbus.h"
#include "wizard.h"
+#include "libreport-gtk.h"
#define DEFAULT_WIDTH 800
#define DEFAULT_HEIGHT 500
@@ -760,6 +779,17 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
strbuf_clear(evd->event_log);
evd->event_log_state = LOGSTATE_FIRSTLINE;
+ if (geteuid() == 0)
+ {
+ /* Reset mode/uig/gid to correct values for all files created by event run */
+ struct dump_dir *dd = dd_opendir(g_dump_dir_name, 0);
+ if (dd)
+ {
+ dd_sanitize_mode_and_owner(dd);
+ dd_close(dd);
+ }
+ }
+
/* Stop if exit code is not 0, or no more commands */
if (retval != 0
|| spawn_next_command_in_evd(evd) < 0
@@ -850,7 +880,8 @@ static void start_event_run(const char *event_name,
/* Load /etc/abrt/events/foo.{conf,xml} stuff */
load_event_config_data();
-//TODO: load overrides from keyring? Load ~/.abrt/events/foo.conf?
+ load_event_config_data_from_keyring();
+ //TODO: Load ~/.abrt/events/foo.conf?
GList *env_list = export_event_config(event_name);
if (spawn_next_command(state, g_dump_dir_name, event_name) < 0)
@@ -884,6 +915,8 @@ static void start_event_run(const char *event_name,
);
gtk_label_set_text(status_label, start_msg);
+//TODO: save_to_event_log(evd, "message that we run event foo")?
+
/* Freeze assistant so it can't move away from the page until event run is done */
gtk_assistant_set_page_complete(g_assistant, page, false);
}
@@ -1035,6 +1068,11 @@ static void next_page(GtkAssistant *assistant, gpointer user_data)
}
}
+static void on_show_event_list_cb(GtkWidget *button, gpointer user_data)
+{
+ show_events_list_dialog(GTK_WINDOW(g_assistant));
+}
+
static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
{
if (pages[PAGENO_BACKTRACE_APPROVAL].page_widget == page)
@@ -1105,8 +1143,8 @@ static gboolean highlight_search(gpointer user_data)
gtk_text_buffer_get_start_iter(buffer, &start_find);
gtk_text_buffer_get_end_iter(buffer, &end_find);
gtk_text_buffer_remove_tag_by_name(buffer, "search_result_bg", &start_find, &end_find);
- VERB1 log("searching: %s\n", gtk_entry_get_text(entry));
- while(gtk_text_iter_forward_search(&start_find, gtk_entry_get_text(entry),
+ VERB1 log("searching: %s", gtk_entry_get_text(entry));
+ while (gtk_text_iter_forward_search(&start_find, gtk_entry_get_text(entry),
GTK_TEXT_SEARCH_TEXT_ONLY, &start_match,
&end_match, NULL))
{
@@ -1244,6 +1282,16 @@ static void add_pages(void)
//gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_REPORTER_SELECTOR].page_widget, false);
gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
gtk_toggle_button_get_active(g_tb_approve_bt));
+
+ /* configure btn on select analyzers page */
+ GtkWidget *config_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button_cfg1"));
+ if (config_btn)
+ g_signal_connect(G_OBJECT(config_btn), "clicked", G_CALLBACK(on_show_event_list_cb), NULL);
+
+ /* configure btn on select reporters page */
+ config_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button_cfg2"));
+ if (config_btn)
+ g_signal_connect(G_OBJECT(config_btn), "clicked", G_CALLBACK(on_show_event_list_cb), NULL);
}
void create_assistant()
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
index fa9f15ed..bff2c3e0 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -168,15 +168,44 @@
<child>
<placeholder/>
</child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
<child>
- <placeholder/>
+ <object class="GtkButton" id="button_cfg1">
+ <property name="label" translatable="yes">Configure Events</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image_position">right</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -255,15 +284,44 @@
<child>
<placeholder/>
</child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
<child>
- <placeholder/>
+ <object class="GtkButton" id="button_cfg2">
+ <property name="label" translatable="yes">Configure Events</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image_position">right</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
diff --git a/src/gui-wizard-gtk/wizard.h b/src/gui-wizard-gtk/wizard.h
index 322b338f..a27a27d9 100644
--- a/src/gui-wizard-gtk/wizard.h
+++ b/src/gui-wizard-gtk/wizard.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
void create_assistant(void);
void update_gui_state_from_crash_data(void);
void show_error_as_msgbox(const char *msg);
diff --git a/src/include/report/dump_dir.h b/src/include/report/dump_dir.h
index 86bfcf0e..a97a4f5c 100644
--- a/src/include/report/dump_dir.h
+++ b/src/include/report/dump_dir.h
@@ -50,8 +50,11 @@ struct dump_dir *dd_opendir(const char *dir, int flags);
* (IOW: if you aren't running under root):
*/
struct dump_dir *dd_create(const char *dir, uid_t uid);
+
void dd_create_basic_files(struct dump_dir *dd, uid_t uid);
int dd_exist(struct dump_dir *dd, const char *path);
+void dd_sanitize_mode_and_owner(struct dump_dir *dd);
+
DIR *dd_init_next_file(struct dump_dir *dd);
int dd_get_next_file(struct dump_dir *dd, char **short_name, char **full_name);
diff --git a/src/lib/abrt_dbus.c b/src/lib/abrt_dbus.c
index 5d8d861d..a4bab15f 100644
--- a/src/lib/abrt_dbus.c
+++ b/src/lib/abrt_dbus.c
@@ -777,7 +777,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg)
{
error_msg_and_die("dbus Warning message: arguments mismatch");
}
- log(">! %s\n", warning_msg);
+ log(">! %s", warning_msg);
}
else
if (tp == DBUS_MESSAGE_TYPE_METHOD_RETURN
diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c
index d0b1d478..fefec608 100644
--- a/src/lib/dump_dir.c
+++ b/src/lib/dump_dir.c
@@ -491,6 +491,53 @@ void dd_create_basic_files(struct dump_dir *dd, uid_t uid)
free(release);
}
+void dd_sanitize_mode_and_owner(struct dump_dir *dd)
+{
+ /* Don't sanitize if we aren't run under root:
+ * we assume that during file creation (by whatever means,
+ * even by "hostname >file" in abrt_event.conf)
+ * normal umask-based mode setting takes care of correct mode,
+ * and uid:gid is, of course, set to user's uid and gid.
+ *
+ * For root operating on /var/spool/abrt/USERS_PROBLEM, this isn't true:
+ * "hostname >file", for example, would create file OWNED BY ROOT!
+ * This routine resets mode and uid:gid for all such files.
+ */
+ if (dd->dd_uid == (uid_t)-1)
+ return;
+
+ if (!dd->locked)
+ error_msg_and_die("dump_dir is not opened"); /* bug */
+
+ DIR *d = opendir(dd->dd_dirname);
+ if (!d)
+ return;
+
+ struct dirent *dent;
+ while ((dent = readdir(d)) != NULL)
+ {
+ if (dent->d_name[0] == '.') /* ".lock", ".", ".."? skip */
+ continue;
+ char *full_path = concat_path_file(dd->dd_dirname, dent->d_name);
+ struct stat statbuf;
+ if (lstat(full_path, &statbuf) == 0 && S_ISREG(statbuf.st_mode))
+ {
+ if ((statbuf.st_mode & 0777) != 0640)
+ chmod(full_path, 0640);
+ if (statbuf.st_uid != dd->dd_uid || statbuf.st_gid != dd->dd_gid)
+ {
+ if (chown(full_path, dd->dd_uid, dd->dd_gid) != 0)
+ {
+ perror_msg("can't change '%s' ownership to %lu:%lu", full_path,
+ (long)dd->dd_uid, (long)dd->dd_gid);
+ }
+ }
+ }
+ free(full_path);
+ }
+ closedir(d);
+}
+
static int delete_file_dir(const char *dir, bool skip_lock_file)
{
DIR *d = opendir(dir);
@@ -615,7 +662,7 @@ static char *load_text_file(const char *path, unsigned flags)
static bool save_binary_file(const char *path, const char* data, unsigned size, uid_t uid, gid_t gid)
{
- /* "Why 0640?!" See ::Create() for security analysis */
+ /* "Why 0640?!" See dd_create() for security analysis */
unlink(path);
int fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, 0640);
if (fd < 0)
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index 5532710a..6207f721 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include "abrtlib.h"
GHashTable *g_event_config_list;
@@ -48,7 +66,7 @@ static int cmp_event_option_name_with_string(gconstpointer a, gconstpointer b)
event_option_t *get_event_option_from_list(const char *name, GList *options)
{
GList *elem = g_list_find_custom(options, name, &cmp_event_option_name_with_string);
- if(elem)
+ if (elem)
return (event_option_t *)elem->data;
return NULL;
}
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
index f24606e0..9277aea4 100644
--- a/src/lib/event_xml_parser.c
+++ b/src/lib/event_xml_parser.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include "abrtlib.h"
#include "event_config.h"
@@ -79,7 +97,7 @@ static void start_element(GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
- //g_print("start: %s\n", element_name);
+ //log("start: %s", element_name);
struct my_parse_data *parse_data = user_data;
diff --git a/src/lib/steal_directory.c b/src/lib/steal_directory.c
index a77861ee..6676a5fa 100644
--- a/src/lib/steal_directory.c
+++ b/src/lib/steal_directory.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include "abrtlib.h"
struct dump_dir *steal_directory(const char *base_dir, const char *dump_dir_name)
diff --git a/src/plugins/abrt-action-install-debuginfo.c b/src/plugins/abrt-action-install-debuginfo.c
index 77cd370b..74990622 100644
--- a/src/plugins/abrt-action-install-debuginfo.c
+++ b/src/plugins/abrt-action-install-debuginfo.c
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include <unistd.h>
#include <string.h>
diff --git a/src/plugins/abrt-action-kerneloops.c b/src/plugins/abrt-action-kerneloops.c
index 8d00da52..fdcf4182 100644
--- a/src/plugins/abrt-action-kerneloops.c
+++ b/src/plugins/abrt-action-kerneloops.c
@@ -30,7 +30,7 @@ static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
/*
char *c, *c1, *c2;
- log("received: '%*.*s'\n", (int)size, (int)size, (char*)ptr);
+ log("received: '%*.*s'", (int)size, (int)size, (char*)ptr);
c = (char*)xzalloc(size + 1);
memcpy(c, ptr, size);
c1 = strstr(c, "201 ");
diff --git a/src/plugins/abrt-action-mailx.c b/src/plugins/abrt-action-mailx.c
index 06f81780..f9e82b04 100644
--- a/src/plugins/abrt-action-mailx.c
+++ b/src/plugins/abrt-action-mailx.c
@@ -1,6 +1,4 @@
/*
- Mailx.cpp
-
Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com)
Copyright (C) 2009 RedHat inc.