updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / firestarter-gtkstatusicon / events-log-fix.patch
blobc8d96766b4948b2fefc338f192093eb211480f70
1 --- firestarter-1.0.3.orig/firestarter.schemas.in 2005-01-29 20:32:09.000000000 +0800
2 +++ firestarter-1.0.3/firestarter.schemas.in 2006-12-20 20:18:02.000000000 +0800
3 @@ -82,7 +82,7 @@
4 <applyto>/apps/firestarter/client/system_log</applyto>
5 <owner>Firestarter</owner>
6 <type>string</type>
7 - <default>/var/log/messages</default>
8 + <default>/var/log/iptables.log</default>
9 <locale name="C">
10 <short>The system log file</short>
11 <long>The location of the file the system logging daemon writes to.</long>
12 --- firestarter-1.0.3.orig/src/logread.c 2005-01-29 20:32:08.000000000 +0800
13 +++ firestarter-1.0.3/src/logread.c 2008-03-11 21:24:54.000000000 +0800
14 @@ -189,6 +194,10 @@
16 void
17 open_logfile (char *logpath) {
18 + /* Check if logpath isn't NULL before proceeding to avoid libgnomevfs-CRITICAL errors */
19 + if (logpath == NULL)
20 + return;
22 GnomeVFSAsyncHandle *handle;
24 gnome_vfs_async_open(&handle, logpath, GNOME_VFS_OPEN_READ, GNOME_VFS_PRIORITY_DEFAULT,
25 --- firestarter-1.0.3.orig/src/util.c 2005-01-29 20:32:08.000000000 +0800
26 +++ firestarter-1.0.3/src/util.c 2006-12-20 20:31:06.000000000 +0800
27 @@ -24,6 +24,7 @@
28 #include "util.h"
29 #include "hitview.h"
30 #include "preferences.h"
31 +#include "logread.h"
33 extern int h_errno;
35 @@ -121,13 +122,18 @@
36 /* User has specified the log file location */
37 path = preferences_get_string (PREFS_SYSLOG_FILE);
39 - if (path && g_file_test (path, G_FILE_TEST_EXISTS)) {
40 + if (path && g_file_test (path, G_FILE_TEST_EXISTS) && parse_log_line (path)->time != "") {
41 return path;
42 - } else { /* Try to guess some default syslog location */
43 - if (g_file_test ("/var/log/messages", G_FILE_TEST_EXISTS))
44 - path = g_strdup ("/var/log/messages");
45 - else if (g_file_test ("/var/log/kernel", G_FILE_TEST_EXISTS))
46 + } else { /* Guess default kernel messages log path: syslog-ng first, then sysklogd and metalog */
47 + if (g_file_test ("/var/log/iptables.log", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/iptables.log")->time != "")
48 + path = g_strdup ("/var/log/iptables.log");
49 + else if (g_file_test ("/var/log/kernel", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/kernel")->time != "")
50 path = g_strdup ("/var/log/kernel");
51 + /* Let's try these just in case */
52 + else if (g_file_test ("/var/log/messages.log", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/messages.log")->time != "")
53 + path = g_strdup ("/var/log/messages.log");
54 + else if (g_file_test ("/var/log/messages", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/messages")->time != "")
55 + path = g_strdup ("/var/log/messages");
56 else
57 path = NULL;