summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Seiler <rizzo@gentoo.org>2004-08-17 01:32:04 +0000
committerDon Seiler <rizzo@gentoo.org>2004-08-17 01:32:04 +0000
commita299c8feb5a04d9e91cbc75018acfc0f47458dea (patch)
treef043f2341ddd7a96d4c1941f1983d6d9ba529a02 /net-im/gaim/files
parentclean older versions (diff)
downloadhistorical-a299c8feb5a04d9e91cbc75018acfc0f47458dea.tar.gz
historical-a299c8feb5a04d9e91cbc75018acfc0f47458dea.tar.bz2
historical-a299c8feb5a04d9e91cbc75018acfc0f47458dea.zip
Patches for a file descriptor leak and issue with smileys
Diffstat (limited to 'net-im/gaim/files')
-rw-r--r--net-im/gaim/files/digest-gaim-0.81-r21
-rw-r--r--net-im/gaim/files/gaim-0.82cvs-gtkprefs-fix.patch27
-rw-r--r--net-im/gaim/files/syslog_fd_leak.diff263
3 files changed, 291 insertions, 0 deletions
diff --git a/net-im/gaim/files/digest-gaim-0.81-r2 b/net-im/gaim/files/digest-gaim-0.81-r2
new file mode 100644
index 000000000000..0f0ac7561307
--- /dev/null
+++ b/net-im/gaim/files/digest-gaim-0.81-r2
@@ -0,0 +1 @@
+MD5 ee3460363f51ad24db1c5697d1da3c1b gaim-0.81.tar.bz2 4588215
diff --git a/net-im/gaim/files/gaim-0.82cvs-gtkprefs-fix.patch b/net-im/gaim/files/gaim-0.82cvs-gtkprefs-fix.patch
new file mode 100644
index 000000000000..c50f48395d17
--- /dev/null
+++ b/net-im/gaim/files/gaim-0.82cvs-gtkprefs-fix.patch
@@ -0,0 +1,27 @@
+Index: src/gtkprefs.c
+===================================================================
+RCS file: /cvsroot/gaim/gaim/src/gtkprefs.c,v
+retrieving revision 1.199
+diff -u -p -r1.199 gtkprefs.c
+--- src/gtkprefs.c 10 Aug 2004 12:57:41 -0000 1.199
++++ src/gtkprefs.c 17 Aug 2004 00:42:38 -0000
+@@ -523,7 +523,7 @@ GtkTreePath *theme_refresh_theme_list()
+
+ void theme_install_theme(char *path, char *extn) {
+ #ifndef _WIN32
+- gchar *command;
++ gchar *command, *escaped;
+ #endif
+ gchar *destdir;
+ gchar *tail;
+@@ -544,7 +544,9 @@ void theme_install_theme(char *path, cha
+ * other platforms, if need be */
+ if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) {
+ #ifndef _WIN32
+- command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir);
++ escaped = g_shell_quote(path);
++ command = g_strdup_printf("tar > /dev/null xzf %s -C %s", escaped, destdir);
++ g_free(escaped);
+ #else
+ if(!wgaim_gz_untar(path, destdir)) {
+ g_free(destdir);
diff --git a/net-im/gaim/files/syslog_fd_leak.diff b/net-im/gaim/files/syslog_fd_leak.diff
new file mode 100644
index 000000000000..780ee0ba5840
--- /dev/null
+++ b/net-im/gaim/files/syslog_fd_leak.diff
@@ -0,0 +1,263 @@
+diff -urd gaim-0.81/src/log.c gaim-0.81-new/src/log.c
+--- gaim-0.81/src/log.c 2004-08-05 10:34:02.000000000 -0700
++++ gaim-0.81-new/src/log.c 2004-08-15 19:43:02.000000000 -0700
+@@ -332,6 +332,60 @@
+ FILE *file;
+ };
+
++static void log_writer_common(GaimLog *log, GaimMessageFlags type,
++ const char *prpl, time_t time,
++ const char *ext)
++{
++ char date[64];
++ struct generic_logger_data *data = log->logger_data;
++
++ if(!data) {
++ /* This log is new */
++ char *ud = gaim_user_dir();
++ char *acct_name = g_strdup(gaim_normalize(log->account,
++ gaim_account_get_username(log->account)));
++ char *target;
++ char *dir;
++ char *filename, *path;
++
++ printf("%s\n", acct_name);
++
++ if (log->type == GAIM_LOG_CHAT) {
++ target = g_strdup_printf("%s.chat", gaim_normalize(log->account,
++ log->name));
++ } else if(log->type == GAIM_LOG_SYSTEM) {
++ target = g_strdup(".system");
++ } else {
++ target = g_strdup(gaim_normalize(log->account, log->name));
++ }
++
++ strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S", localtime(&log->time));
++
++ dir = g_build_filename(ud, "logs",
++ prpl, acct_name, target, NULL);
++ gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
++ g_free(target);
++ g_free(acct_name);
++
++ filename = g_strdup_printf("%s%s", date, ext ? ext : "");
++
++ path = g_build_filename(dir, filename, NULL);
++ g_free(dir);
++ g_free(filename);
++
++ log->logger_data = data = g_new0(struct generic_logger_data, 1);
++
++ data->file = fopen(path, "a");
++ if (!data->file) {
++ gaim_debug(GAIM_DEBUG_ERROR, "log",
++ "Could not create log file %s\n", filename);
++ g_free(path);
++ return;
++ }
++ g_free(path);
++ }
++}
++
+ static GList *log_lister_common(GaimLogType type, const char *name, GaimAccount *account, const char *ext, GaimLogLogger *logger)
+ {
+ GDir *dir;
+@@ -505,47 +559,23 @@
+ static void html_logger_write(GaimLog *log, GaimMessageFlags type,
+ const char *from, time_t time, const char *message)
+ {
+- char date[64];
+ char *msg_fixed;
+- struct generic_logger_data *data = log->logger_data;
++ char date[64];
+ GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account));
+ const char *prpl_name = plugin->info->name;
++ struct generic_logger_data *data = log->logger_data;
+
+ if(!data) {
+- /* This log is new */
+- char *ud = gaim_user_dir();
+- char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account)));
+- char *chat;
+- const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL);
+- char *dir;
+- char *filename;
+-
+- if (log->type == GAIM_LOG_CHAT) {
+- chat = g_strdup_printf("%s.chat", guy);
+- g_free(guy);
+- guy = chat;
+- }
+-
+- strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.html", localtime(&log->time));
+-
+- dir = g_build_filename(ud, "logs",
+- prpl, guy, gaim_normalize(log->account, log->name), NULL);
+- gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+- g_free(guy);
+-
+- filename = g_build_filename(dir, date, NULL);
+- g_free(dir);
++ const char *prpl =
++ GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL);
++ log_writer_common(log, type, prpl, time, ".html");
+
+- log->logger_data = data = g_new0(struct generic_logger_data, 1);
++ data = log->logger_data;
+
+- data->file = fopen(filename, "a");
+- if (!data->file) {
+- gaim_debug(GAIM_DEBUG_ERROR, "log",
+- "Could not create log file %s\n", filename);
+- g_free(filename);
++ /* if we can't write to the file, give up before we hurt ourselves */
++ if(!data->file)
+ return;
+- }
+- g_free(filename);
++
+ strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", localtime(&log->time));
+ fprintf(data->file, "<html><head><title>");
+ fprintf(data->file, "Conversation with %s at %s on %s (%s)",
+@@ -554,11 +584,8 @@
+ fprintf(data->file,
+ "<h3>Conversation with %s at %s on %s (%s)</h3>\n",
+ log->name, date, gaim_account_get_username(log->account), prpl);
+- }
+
+- /* if we can't write to the file, give up before we hurt ourselves */
+- if(!data->file)
+- return;
++ }
+
+ gaim_markup_html_to_xhtml(message, &msg_fixed, NULL);
+
+@@ -642,35 +669,6 @@
+
+ static void html_logger_create(GaimLog *log)
+ {
+- if(log->type == GAIM_LOG_SYSTEM){
+- char date[64];
+- const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO
+- (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL);
+- char *ud = gaim_user_dir();
+- char *dir = g_build_filename(ud, "logs", prpl, log->name, ".system", NULL);
+- char *filename;
+- struct generic_logger_data *data;
+-
+- gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+- strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.html", localtime(&log->time));
+- filename = g_build_filename(dir, date, NULL);
+- g_free(dir);
+-
+- log->logger_data = data = g_new0(struct generic_logger_data, 1);
+-
+- data->file = fopen(filename, "a");
+- if (!data->file) {
+- gaim_debug(GAIM_DEBUG_ERROR, "log",
+- "Could not create log file %s\n", filename);
+- g_free(filename);
+- return;
+- }
+- fprintf(data->file, "<html><head><title>");
+- fprintf(data->file, "System Log for %s (%s)",
+- gaim_account_get_username(log->account), prpl);
+- fprintf(data->file, "</title></head><body>");
+- g_free(filename);
+- }
+ }
+
+ static GaimLogLogger html_logger = {
+@@ -697,49 +695,25 @@
+ const char *from, time_t time, const char *message)
+ {
+ char date[64];
+- char *stripped = NULL;
++ GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account));
+ struct generic_logger_data *data = log->logger_data;
+- if (!data) {
++ char *stripped = NULL;
++
++ if(!data) {
+ /* This log is new. We could use the loggers 'new' function, but
+ * creating a new file there would result in empty files in the case
+ * that you open a convo with someone, but don't say anything.
+- *
+- * The log is also not a system log. Because if it is, data would
+- * be created in txt_logger_create
+ */
+- char *ud = gaim_user_dir();
+- char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account)));
+- char *chat;
+- const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO
+- (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL);
+- char *dir;
+- char *filename;
+-
+- if (log->type == GAIM_LOG_CHAT) {
+- chat = g_strdup_printf("%s.chat", guy);
+- g_free(guy);
+- guy = chat;
+- }
+-
+- strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.txt", localtime(&log->time));
+-
+- dir = g_build_filename(ud, "logs",
+- prpl, guy, gaim_normalize(log->account, log->name), NULL);
+- gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+- g_free(guy);
+-
+- filename = g_build_filename(dir, date, NULL);
+- g_free(dir);
++ const char *prpl =
++ GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL);
++ log_writer_common(log, type, prpl, time, ".txt");
+
+- log->logger_data = data = g_new0(struct generic_logger_data, 1);
++ data = log->logger_data;
+
+- data->file = fopen(filename, "a");
+- if (!data->file) {
+- gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename);
+- g_free(filename);
++ /* if we can't write to the file, give up before we hurt ourselves */
++ if(!data->file)
+ return;
+- }
+- g_free(filename);
++
+ strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", localtime(&log->time));
+ fprintf(data->file, "Conversation with %s at %s on %s (%s)\n",
+ log->name, date, gaim_account_get_username(log->account), prpl);
+@@ -831,31 +805,6 @@
+
+ static void txt_logger_create(GaimLog *log)
+ {
+- if(log->type == GAIM_LOG_SYSTEM){
+- char date[64];
+- const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO
+- (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL);
+- char *ud = gaim_user_dir();
+- char *dir = g_build_filename(ud, "logs", prpl, log->name, ".system", NULL);
+- char *filename;
+- struct generic_logger_data *data;
+-
+- gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+- strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.txt", localtime(&log->time));
+- filename = g_build_filename(dir, date, NULL);
+- g_free(dir);
+-
+- log->logger_data = data = g_new0(struct generic_logger_data, 1);
+-
+- data->file = fopen(filename, "a");
+- if (!data->file) {
+- gaim_debug(GAIM_DEBUG_ERROR, "log",
+- "Could not create log file %s\n", filename);
+- g_free(filename);
+- return;
+- }
+- g_free(filename);
+- }
+ }
+
+ static GaimLogLogger txt_logger = {