diff options
Diffstat (limited to 'events-log-fix.patch')
-rwxr-xr-x | events-log-fix.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/events-log-fix.patch b/events-log-fix.patch new file mode 100755 index 000000000000..c8d96766b494 --- /dev/null +++ b/events-log-fix.patch @@ -0,0 +1,58 @@ +--- firestarter-1.0.3.orig/firestarter.schemas.in 2005-01-29 20:32:09.000000000 +0800 ++++ firestarter-1.0.3/firestarter.schemas.in 2006-12-20 20:18:02.000000000 +0800 +@@ -82,7 +82,7 @@ + <applyto>/apps/firestarter/client/system_log</applyto> + <owner>Firestarter</owner> + <type>string</type> +- <default>/var/log/messages</default> ++ <default>/var/log/iptables.log</default> + <locale name="C"> + <short>The system log file</short> + <long>The location of the file the system logging daemon writes to.</long> +--- firestarter-1.0.3.orig/src/logread.c 2005-01-29 20:32:08.000000000 +0800 ++++ firestarter-1.0.3/src/logread.c 2008-03-11 21:24:54.000000000 +0800 +@@ -189,6 +194,10 @@ + */ + void + open_logfile (char *logpath) { ++ /* Check if logpath isn't NULL before proceeding to avoid libgnomevfs-CRITICAL errors */ ++ if (logpath == NULL) ++ return; ++ + GnomeVFSAsyncHandle *handle; + + gnome_vfs_async_open(&handle, logpath, GNOME_VFS_OPEN_READ, GNOME_VFS_PRIORITY_DEFAULT, +--- firestarter-1.0.3.orig/src/util.c 2005-01-29 20:32:08.000000000 +0800 ++++ firestarter-1.0.3/src/util.c 2006-12-20 20:31:06.000000000 +0800 +@@ -24,6 +24,7 @@ + #include "util.h" + #include "hitview.h" + #include "preferences.h" ++#include "logread.h" + + extern int h_errno; + +@@ -121,13 +122,18 @@ + /* User has specified the log file location */ + path = preferences_get_string (PREFS_SYSLOG_FILE); + +- if (path && g_file_test (path, G_FILE_TEST_EXISTS)) { ++ if (path && g_file_test (path, G_FILE_TEST_EXISTS) && parse_log_line (path)->time != "") { + return path; +- } else { /* Try to guess some default syslog location */ +- if (g_file_test ("/var/log/messages", G_FILE_TEST_EXISTS)) +- path = g_strdup ("/var/log/messages"); +- else if (g_file_test ("/var/log/kernel", G_FILE_TEST_EXISTS)) ++ } else { /* Guess default kernel messages log path: syslog-ng first, then sysklogd and metalog */ ++ if (g_file_test ("/var/log/iptables.log", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/iptables.log")->time != "") ++ path = g_strdup ("/var/log/iptables.log"); ++ else if (g_file_test ("/var/log/kernel", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/kernel")->time != "") + path = g_strdup ("/var/log/kernel"); ++ /* Let's try these just in case */ ++ else if (g_file_test ("/var/log/messages.log", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/messages.log")->time != "") ++ path = g_strdup ("/var/log/messages.log"); ++ else if (g_file_test ("/var/log/messages", G_FILE_TEST_EXISTS) && parse_log_line ("/var/log/messages")->time != "") ++ path = g_strdup ("/var/log/messages"); + else + path = NULL; + } |