Hello community,
here is the log from the commit of package kerneloops
checked in at Fri Sep 26 14:57:58 CEST 2008.
--------
--- kerneloops/kerneloops.changes 2008-08-08 20:04:16.000000000 +0200
+++ /mounts/work_src_done/STABLE/kerneloops/kerneloops.changes 2008-09-26 06:02:23.802912000 +0200
@@ -1,0 +2,14 @@
+Wed Sep 24 23:13:31 PDT 2008 - bphilips@suse.de
+
+- updates to version 0.12
+ * Add format string security error checking to build
+ * Fix format string error
+ * syslog the submit URL as well
+ * With thanks to Owen... now the send button will close the dialog
+ * signal to the kernel that we're not timing critical and that our
+ wakeups can be grouped
+ * also catch net device watchdog timeouts
+ * make kerneloops daemon more boot time friendly
+
+
+-------------------------------------------------------------------
Old:
----
0001-Fix-up-some-weird-git-damage.patch
0002-kerneloops-applet-fix-string-handling-make-window.patch
0003-kerneloops-applet-use-monospace-fonts-in-detail-vie.patch
0004-kerneloops-applet-Fix-Gtk-WARNING-gtkwidget.c-5.patch
New:
----
0001-kerneloops-add-debug-dbus-to-daemon-options.patch
0001-syslog-the-submit-URL-as-well.patch
0002-Fix-format-string-vulnerability.patch
0003-Add-format-string-security-error-checking-to-build.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kerneloops.spec ++++++
--- /var/tmp/diff_new_pack.L18524/_old 2008-09-26 14:56:40.000000000 +0200
+++ /var/tmp/diff_new_pack.L18524/_new 2008-09-26 14:56:40.000000000 +0200
@@ -21,7 +21,7 @@
Name: kerneloops
Version: 0.12
-Release: 1
+Release: 27
License: GPL v2 only
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: curl-devel dbus-1-glib-devel desktop-file-utils gtk2-devel libnotify-devel update-desktop-files
@@ -29,10 +29,10 @@
Summary: Tool to collect kernel oopses and submit them to kerneloops.org
Source: %{name}-%{version}.tar.bz2
Source1: %{name}.init
-Patch: 0001-Fix-up-some-weird-git-damage.patch
-Patch1: 0002-kerneloops-applet-fix-string-handling-make-window.patch
-Patch2: 0003-kerneloops-applet-use-monospace-fonts-in-detail-vie.patch
-Patch3: 0004-kerneloops-applet-Fix-Gtk-WARNING-gtkwidget.c-5.patch
+Patch: 0001-syslog-the-submit-URL-as-well.patch
+Patch1: 0002-Fix-format-string-vulnerability.patch
+Patch2: 0003-Add-format-string-security-error-checking-to-build.patch
+Patch3: 0001-kerneloops-add-debug-dbus-to-daemon-options.patch
PreReq: %insserv_prereq
%description
@@ -127,6 +127,16 @@
%{_datadir}/%{name}/icon.png
%changelog
+* Thu Sep 25 2008 bphilips@suse.de
+- updates to version 0.12
+ * Add format string security error checking to build
+ * Fix format string error
+ * syslog the submit URL as well
+ * With thanks to Owen... now the send button will close the dialog
+ * signal to the kernel that we're not timing critical and that our
+ wakeups can be grouped
+ * also catch net device watchdog timeouts
+ * make kerneloops daemon more boot time friendly
* Fri Aug 08 2008 bphilips@suse.de
- update to version 0.12
* Add a "Show me my oops before submit" button.
@@ -140,12 +150,12 @@
* add a --file option
* Pass $OPTS to kerneloops from /etc/sysconfig/kerneloops.
* Print a URL to the submitted oops in the thank you screen
-* Fri Apr 25 2008 crrodriguez@suse.de
+* Thu Apr 24 2008 crrodriguez@suse.de
- update to version 0.11
* Improve the makefile (GregKH)
* Take various fixes from Chuck Ebbert (Red Hat) based on Fedora
feedback
* Put a link to the submitted oops in the "thanks" screen
* Consider stack overflow warnings also kernel badness
-* Thu Apr 03 2008 crrodriguez@suse.de
+* Wed Apr 02 2008 crrodriguez@suse.de
- initial version for openSUSE 11
++++++ 0001-kerneloops-add-debug-dbus-to-daemon-options.patch ++++++
From 1c2db9efe22ecc1cad5346eda88e7526e34d1bc9 Mon Sep 17 00:00:00 2001
From: Brandon Philips
Date: Thu, 25 Sep 2008 20:35:01 -0700
Subject: [PATCH] kerneloops: add --debug-dbus to daemon options
--debug-dbus will run the kerneloops daemon in debug mode with the dbus client
interaction. This is a handy way to test the client.
Signed-off-by: Brandon Philips
---
kerneloops.c | 6 +++++-
submit.c | 8 ++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/kerneloops.c b/kerneloops.c
index 0efbd40..de1ba09 100644
--- a/kerneloops.c
+++ b/kerneloops.c
@@ -151,6 +151,9 @@ int main(int argc, char**argv)
testmode = 1;
opted_in = 2;
}
+ /* Test DBUS and notification client, exit on submit_queue */
+ if (argc > 1 && strstr(argv[1], "--debug-dbus"))
+ opted_in = 1;
if (!opted_in && !testmode) {
fprintf(stderr, " [Inactive by user preference]");
@@ -203,7 +206,8 @@ int main(int argc, char**argv)
}
}
- if (testmode) {
+ /* Disconnect dbus if not --debug-dbus */
+ if (testmode && opted_in == 2) {
g_main_loop_unref(loop);
dbus_bus_remove_match(bus, "type='signal',interface='org.kerneloops.submit.ping'", &error);
dbus_bus_remove_match(bus, "type='signal',interface='org.kerneloops.submit.permission'", &error);
diff --git a/submit.c b/submit.c
index 6f1d8c0..a7d4b42 100644
--- a/submit.c
+++ b/submit.c
@@ -212,6 +212,10 @@ void submit_queue(void)
if (testmode) {
print_queue();
+
+ if (opted_in == 1)
+ exit(EXIT_SUCCESS);
+
return;
}
@@ -284,6 +288,10 @@ void clear_queue(void)
free(oops);
oops = next;
}
+
+ if (testmode)
+ exit(EXIT_SUCCESS);
+
write_logfile(0);
}
--
1.5.6
++++++ 0001-syslog-the-submit-URL-as-well.patch ++++++
From b83a592acb42220474d81a5d68e30f95edc43efb Mon Sep 17 00:00:00 2001
From: Arjan van de Ven
Date: Mon, 15 Sep 2008 12:03:34 -0700
Subject: [PATCH] syslog the submit URL as well
---
kerneloops-applet.c | 7 ++++---
kerneloops.c | 4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/kerneloops-applet.c b/kerneloops-applet.c
index 6acefc5..3f07f6c 100644
--- a/kerneloops-applet.c
+++ b/kerneloops-applet.c
@@ -280,7 +280,7 @@ char url_to_oops[4095];
static void sent_an_oops(void)
{
char *summary = _("Kernel bug diagnostic information sent");
- char message[8200];
+ char *message = NULL;
char *message_1 =
_("Diagnostic information from your Linux kernel has been "
"sent to http://www.kerneloops.org\">www.kerneloops.org</a> "
@@ -299,9 +299,9 @@ static void sent_an_oops(void)
if (strlen(url_to_oops)==0)
- sprintf(message, message_1);
+ message = g_strdup_printf("%s", message_1);
else
- sprintf(message, message_2, url_to_oops);
+ message = g_strdup_printf(message_2, url_to_oops);
url_to_oops[0] = 0;
@@ -323,6 +323,7 @@ static void sent_an_oops(void)
callback, "never", NULL);
notify_notification_show(notify, NULL);
+ g_free(message);
}
/*
diff --git a/kerneloops.c b/kerneloops.c
index 5697ee9..0efbd40 100644
--- a/kerneloops.c
+++ b/kerneloops.c
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include
#include
@@ -118,6 +119,7 @@ void dbus_say_thanks(char *url)
dbus_message_append_args (message, DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID);
dbus_connection_send(bus, message, NULL);
dbus_message_unref(message);
+ syslog(LOG_WARNING, "kerneloops.org: oops is posted as %s", url);
}
message = dbus_message_new_signal("/org/kerneloops/submit/sent",
@@ -135,7 +137,7 @@ int main(int argc, char**argv)
/*
* Signal the kernel that we're not timing critical
*/
-#ifdef PR_SET_TIMERSLACK,1000
+#ifdef PR_SET_TIMERSLACK
prctl(PR_SET_TIMERSLACK,1000*1000*1000, 0, 0, 0);
#endif
--
1.5.6
++++++ 0002-Fix-format-string-vulnerability.patch ++++++
From 45d9add57cb217c32e76b9801cbf7ae7a4268c55 Mon Sep 17 00:00:00 2001
From: Matt Zimmerman
Date: Fri, 19 Sep 2008 16:08:00 +0100
Subject: [PATCH] Fix format string vulnerability
Signed-off-by: Matt Zimmerman
---
submit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/submit.c b/submit.c
index 13e1b75..6f1d8c0 100644
--- a/submit.c
+++ b/submit.c
@@ -135,7 +135,7 @@ void write_detail_file(void)
while (oops) {
count++; /* Users are not programmers, start at 1 */
fprintf(tmpf, "Kernel failure message %d:\n", count);
- fprintf(tmpf, oops->text);
+ fprintf(tmpf, "%s", oops->text);
fprintf(tmpf, "\n\n");
oops = oops->next;
}
--
1.5.6
++++++ 0003-Add-format-string-security-error-checking-to-build.patch ++++++
From 123638012f8ed8061f29cd2fa9c8de5e5ea1c33a Mon Sep 17 00:00:00 2001
From: Kees Cook
Date: Fri, 19 Sep 2008 12:21:46 -0700
Subject: [PATCH] Add format string security error checking to build
Signed-off-by: Kees Cook
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 86acdf2..09a5e86 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ LOCALESDIR=/usr/share/locale
MANDIR=/usr/share/man/man8
CC?=gcc
-CFLAGS := -O2 -g -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -W -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wdeclaration-after-statement
+CFLAGS := -O2 -g -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -W -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wformat -Wformat-security -Werror=format-security
MY_CFLAGS := `pkg-config --cflags libnotify gtk+-2.0`
#
--
1.5.6
++++++ kerneloops-0.12.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/dmesg.c new/kerneloops-0.12/dmesg.c
--- old/kerneloops-0.12/dmesg.c 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/dmesg.c 2008-09-13 17:21:04.000000000 +0200
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
/*
* Copyright 2007, Intel Corporation
*
@@ -54,20 +55,25 @@
linecount = 0;
c = buffer;
while (c) {
+ int len = 0;
+ char *c9;
+
+ c9 = strchr(c, '\n');
+ if (c9)
+ len = c9 - c;
+
/* in /var/log/messages, we need to strip the first part off, upto the 3rd ':' */
if (remove_syslog) {
char *c2;
- char *c3;
- c3 = strchr(c, '\n');
/* skip non-kernel lines */
- c2 = strstr(c, "kernel:");
- if (!c2 || (c2 > c3))
- c2 = strstr(c, "kerneloops:");
- if (!c2 || (c2 > c3)) {
- c2 = strchr(c, '\n');
+ c2 = memmem(c, len, "kernel:", 7);
+ if (!c2)
+ c2 = memmem(c, len, "kerneloops:", 11);
+ if (!c2) {
+ c2 = c9;
if (c2) {
- c = c2+1;
+ c = c2 + 1;
continue;
} else
break;
@@ -166,14 +172,20 @@
oopsstart = i;
if (strstr(c, "kernel BUG at"))
oopsstart = i;
+ if (strstr(c, "do_IRQ: stack overflow:"))
+ oopsstart = i;
if (strstr(c, "RTNL: assertion failed"))
oopsstart = i;
if (strstr(c, "Eeek! page_mapcount(page) went negative!"))
oopsstart = i;
+ if (strstr(c, "near stack overflow (cur:"))
+ oopsstart = i;
if (strstr(c, "double fault:"))
oopsstart = i;
if (strstr(c, "Badness at"))
oopsstart = i;
+ if (strstr(c, "NETDEV WATCHDOG"))
+ oopsstart = i;
if (strstr(c, "WARNING:") &&
!strstr(c, "appears to be on the same physical disk"))
oopsstart = i;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops.8 new/kerneloops-0.12/kerneloops.8
--- old/kerneloops-0.12/kerneloops.8 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops.8 2008-09-13 17:21:04.000000000 +0200
@@ -35,6 +35,9 @@
.LP
.TP
+\fB\-\-file filename\fR
+Parse the file denoted with filename as if it were /var/log/messages
+.TP
\fB\-\-debug\fR
Enable debug mode
.TP
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops-applet.c new/kerneloops-0.12/kerneloops-applet.c
--- old/kerneloops-0.12/kerneloops-applet.c 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops-applet.c 2008-09-13 17:21:04.000000000 +0200
@@ -133,10 +133,11 @@
}
/* Called only from the detail window */
-static void send_action(NotifyNotification __unused *notify,
- gchar __unused *action, gpointer __unused user_data)
+static void send_action(GtkWidget __unused *button, GtkWidget *dialog)
{
send_permission("yes");
+
+ gtk_widget_destroy(dialog);
}
@@ -150,6 +151,8 @@
GtkTextBuffer *buffer;
GtkWidget *button_cancel;
GtkWidget *button_send;
+ GtkTextTag *fixed;
+ GtkTextIter iter;
char *detail_data;
struct stat statb;
int detail_fd;
@@ -172,12 +175,13 @@
detail_data = malloc(statb.st_size+1);
if (!detail_data)
return;
-
+
if (read(detail_fd, detail_data, statb.st_size) != statb.st_size) {
free(detail_data);
return;
}
close(detail_fd);
+ detail_data[statb.st_size] = '\0';
dialog = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(dialog), _("Kernel failure details"));
@@ -186,18 +190,20 @@
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollwindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), scrollwindow,
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), scrollwindow,
TRUE, TRUE, 0);
view = gtk_text_view_new();
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW (view));
- gtk_text_buffer_set_text(buffer, detail_data, -1);
+ fixed = gtk_text_buffer_create_tag (buffer, "font", "font", "monospace", NULL);
+ gtk_text_buffer_get_iter_at_line_offset(buffer, &iter, 0, 0);
+ gtk_text_buffer_insert_with_tags(buffer, &iter, detail_data, -1,
+ fixed, NULL);
free(detail_data);
- gtk_scrolled_window_add_with_viewport(
- GTK_SCROLLED_WINDOW(scrollwindow), view);
+ gtk_container_add (GTK_CONTAINER (scrollwindow), view);
+
gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE);
button_send = gtk_button_new_with_label (_("Send"));
GTK_WIDGET_SET_FLAGS(button_send, GTK_CAN_DEFAULT);
- gtk_widget_grab_default(button_send);
button_cancel = gtk_button_new_with_label (_("Cancel"));
g_signal_connect(G_OBJECT(dialog), "delete_event",
@@ -205,16 +211,14 @@
g_signal_connect_swapped(G_OBJECT(button_cancel), "clicked",
G_CALLBACK(gtk_widget_destroy),
G_OBJECT(dialog));
- g_signal_connect(G_OBJECT(dialog), "destroy",
- G_CALLBACK(gtk_widget_destroy),
- G_OBJECT(dialog));
g_signal_connect(G_OBJECT(button_send), "clicked",
- G_CALLBACK(send_action), NULL);
-
+ G_CALLBACK(send_action), dialog);
+
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button_send, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button_cancel, TRUE, TRUE, 0);
+ gtk_widget_grab_default(button_send);
gtk_widget_show(view);
gtk_widget_show(button_send);
@@ -267,6 +271,8 @@
notify_notification_show(notify, NULL);
}
+char url_to_oops[4095];
+
/*
* open a notification window (expires in 5 seconds) to say thank you
* to the user for his bug feedback.
@@ -274,15 +280,32 @@
static void sent_an_oops(void)
{
char *summary = _("Kernel bug diagnostic information sent");
- char *message =
+ char message[8200];
+ char *message_1 =
_("Diagnostic information from your Linux kernel has been "
"sent to http://www.kerneloops.org\">www.kerneloops.org</a> "
"for the Linux kernel developers to work on. \n"
"Thank you for contributing to improve the quality of the Linux kernel.\n");
+
+ char *message_2 =
+ _("Diagnostic information from your Linux kernel has been "
+ "sent to http://www.kerneloops.org\">www.kerneloops.org</a> "
+ "for the Linux kernel developers to work on. \n"
+ "Thank you for contributing to improve the quality of the Linux kernel.\n"
+ "You can view your submitted oops here</a>\n");
NotifyActionCallback callback = notify_action;
close_notification();
+
+ if (strlen(url_to_oops)==0)
+ sprintf(message, message_1);
+ else
+ sprintf(message, message_2, url_to_oops);
+
+
+ url_to_oops[0] = 0;
+
notify = notify_notification_new(summary, message,
"/usr/share/kerneloops/icon.png", NULL);
@@ -302,6 +325,17 @@
notify_notification_show(notify, NULL);
}
+/*
+ * store the URL for the user
+ */
+static void got_an_url(DBusMessage *message)
+{
+ char *string = NULL;
+ dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &string, DBUS_TYPE_INVALID);
+ if (string)
+ strncpy(url_to_oops, string, 4095);
+
+}
/*
@@ -362,6 +396,13 @@
gtk_status_icon_set_visible(statusicon, FALSE);
return DBUS_HANDLER_RESULT_HANDLED;
}
+ /* check if it's the daemon that asks for permission */
+ if (dbus_message_is_signal(message,
+ "org.kerneloops.submit.url", "url")) {
+
+ got_an_url(message);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
@@ -439,6 +480,7 @@
/* set the dbus message to listen for */
dbus_bus_add_match(bus, "type='signal',interface='org.kerneloops.submit.permission'", &error);
dbus_bus_add_match(bus, "type='signal',interface='org.kerneloops.submit.sent'", &error);
+ dbus_bus_add_match(bus, "type='signal',interface='org.kerneloops.submit.url'", &error);
dbus_connection_add_filter(bus, dbus_gotmessage, NULL, NULL);
/*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops.c new/kerneloops-0.12/kerneloops.c
--- old/kerneloops-0.12/kerneloops.c 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops.c 2008-09-13 17:21:04.000000000 +0200
@@ -26,7 +26,8 @@
#include
#include
#include
-
+#include
+#include
#include
#include
@@ -106,11 +107,19 @@
dbus_message_unref(message);
}
-void dbus_say_thanks(void)
+void dbus_say_thanks(char *url)
{
DBusMessage *message;
if (!bus)
return;
+ if (url && strlen(url)) {
+ message = dbus_message_new_signal("/org/kerneloops/submit/url",
+ "org.kerneloops.submit.url", "url");
+ dbus_message_append_args (message, DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID);
+ dbus_connection_send(bus, message, NULL);
+ dbus_message_unref(message);
+ }
+
message = dbus_message_new_signal("/org/kerneloops/submit/sent",
"org.kerneloops.submit.sent", "sent");
dbus_connection_send(bus, message, NULL);
@@ -123,6 +132,13 @@
DBusError error;
int godaemon = 1;
+/*
+ * Signal the kernel that we're not timing critical
+ */
+#ifdef PR_SET_TIMERSLACK,1000
+ prctl(PR_SET_TIMERSLACK,1000*1000*1000, 0, 0, 0);
+#endif
+
read_config_file("/etc/kerneloops.conf");
if (argc > 1 && strstr(argv[1], "--nodaemon"))
@@ -134,7 +150,6 @@
opted_in = 2;
}
-
if (!opted_in && !testmode) {
fprintf(stderr, " [Inactive by user preference]");
return EXIT_SUCCESS;
@@ -152,11 +167,11 @@
curl_global_init(CURL_GLOBAL_ALL);
*/
-
if (godaemon && daemon(0, 0)) {
printf("kerneloops failed to daemonize.. exiting \n");
return EXIT_FAILURE;
}
+ sched_yield();
loop = g_main_loop_new(NULL, FALSE);
dbus_error_init(&error);
@@ -168,10 +183,16 @@
dbus_connection_add_filter(bus, got_message, NULL, NULL);
}
-
/* we scan dmesg before /var/log/messages; dmesg is a more accurate source normally */
scan_dmesg(NULL);
+ /* during boot... don't go too fast and slow the system down */
+ if (!testmode)
+ sleep(10);
scan_filename("/var/log/messages", 1);
+
+ if (argc > 2 && strstr(argv[1], "--file"))
+ scan_filename(argv[2], 1);
+
if (testmode && argc > 2) {
int q;
for (q = 2; q < argc; q++) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops.dbus new/kerneloops-0.12/kerneloops.dbus
--- old/kerneloops-0.12/kerneloops.dbus 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops.dbus 2008-09-13 17:21:04.000000000 +0200
@@ -12,6 +12,7 @@
<allow own="org.kerneloops.submit.ping"/>
<allow own="org.kerneloops.submit.permission"/>
<allow own="org.kerneloops.submit.sent"/>
+ <allow own="org.kerneloops.submit.url"/>
</policy>
<policy at_console="true">
@@ -20,6 +21,7 @@
<allow receive_sender="org.kerneloops.submit"/>
<allow receive_sender="org.kerneloops.submit.permission"/>
<allow receive_sender="org.kerneloops.submit.sent"/>
+ <allow receive_sender="org.kerneloops.submit.url"/>
<allow send_path="/org/kerneloops/submit"/>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops.h new/kerneloops-0.12/kerneloops.h
--- old/kerneloops-0.12/kerneloops.h 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops.h 2008-09-13 17:21:04.000000000 +0200
@@ -40,7 +40,7 @@
extern void ask_permission(void);
extern void dbus_ask_permission(char * detail_file_name);
-extern void dbus_say_thanks(void);
+extern void dbus_say_thanks(char *url);
extern int opted_in;
extern int allow_distro_to_pass_on;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/kerneloops.init new/kerneloops-0.12/kerneloops.init
--- old/kerneloops-0.12/kerneloops.init 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/kerneloops.init 2008-09-13 17:21:04.000000000 +0200
@@ -34,7 +34,7 @@
start() {
echo -n $"Starting $prog:"
- daemon $prog
+ daemon $prog $OPTS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kerneloops-0.12/submit.c new/kerneloops-0.12/submit.c
--- old/kerneloops-0.12/submit.c 2008-06-23 00:00:15.000000000 +0200
+++ new/kerneloops-0.12/submit.c 2008-09-13 17:21:04.000000000 +0200
@@ -182,6 +182,25 @@
closelog();
}
+char result_url[4096];
+
+size_t writefunction( void *ptr, size_t size, size_t nmemb, void __attribute((unused)) *stream)
+{
+ char *c, *c1, *c2;
+ c = malloc(size*nmemb + 1);
+ memset(c, 0, size*nmemb + 1);
+ memcpy(c, ptr, size*nmemb);
+ printf("received %s \n", c);
+ c1 = strstr(c, "201 ");
+ if (c1) {
+ c1+=4;
+ c2 = strchr(c1, '\n');
+ if (c2) *c2 = 0;
+ strncpy(result_url, c1, 4095);
+ }
+ return size * nmemb;
+}
+
void submit_queue(void)
{
int result;
@@ -189,6 +208,8 @@
struct oops *queue;
int count = 0;
+ memset(result_url, 0, 4096);
+
if (testmode) {
print_queue();
return;
@@ -204,8 +225,9 @@
struct curl_httppost *last = NULL;
struct oops *next;
-
handle = curl_easy_init();
+
+ printf("DEBUG SUBMIT URL is %s \n", submit_url);
curl_easy_setopt(handle, CURLOPT_URL, submit_url);
/* set up the POST data */
@@ -220,6 +242,7 @@
}
curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
+ curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction);
result = curl_easy_perform(handle);
curl_formfree(post);
@@ -235,7 +258,7 @@
write_logfile(count);
if (count)
- dbus_say_thanks();
+ dbus_say_thanks(result_url);
/*
* If we've reached the maximum count, we'll exit the program,
* the program won't do any useful work anymore going forward.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org