summaryrefslogtreecommitdiff
path: root/app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch
diff options
context:
space:
mode:
authorBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
committerBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
commit7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch)
tree1684924656132935256e034f35f92abee6623265 /app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch
Added ebuilds for kogaion desktop
Diffstat (limited to 'app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch')
-rw-r--r--app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch b/app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch
new file mode 100644
index 00000000..81272bd3
--- /dev/null
+++ b/app-admin/conky/files/conky-1.8.1-secunia-SA43225.patch
@@ -0,0 +1,72 @@
+--- src/eve.c 2011-02-12 13:26:34.636269667 +0100
++++ src/eve.c 2011-02-12 13:26:48.242936334 +0100
+@@ -254,19 +254,6 @@
+ }
+ }
+
+-static int file_exists(const char *filename)
+-{
+- struct stat fi;
+-
+- if ((stat(filename, &fi)) == 0) {
+- if (fi.st_size > 0)
+- return 1;
+- else
+- return 0;
+- } else
+- return 0;
+-}
+-
+ static void writeSkilltree(char *content, const char *filename)
+ {
+ FILE *fp = fopen(filename, "w");
+@@ -283,13 +270,12 @@
+ xmlDocPtr doc = 0;
+ xmlNodePtr root = 0;
+
+- if (!file_exists(file)) {
+- skilltree = getXmlFromAPI(NULL, NULL, NULL, EVEURL_SKILLTREE);
+- writeSkilltree(skilltree, file);
+- free(skilltree);
+- }
++ skilltree = getXmlFromAPI(NULL, NULL, NULL, EVEURL_SKILLTREE);
++ writeSkilltree(skilltree, file);
++ free(skilltree);
+
+ doc = xmlReadFile(file, NULL, 0);
++ unlink(file);
+ if (!doc)
+ return NULL;
+
+@@ -340,7 +326,7 @@
+ static char *eve(char *userid, char *apikey, char *charid)
+ {
+ Character *chr = NULL;
+- const char *skillfile = "/tmp/.cesf";
++ char skillfile[] = "/tmp/.cesfXXXXXX";
+ int i = 0;
+ char *output = 0;
+ char *timel = 0;
+@@ -348,6 +334,7 @@
+ char *content = 0;
+ time_t now = 0;
+ char *error = 0;
++ int tmp_fd, old_umask;
+
+
+ for (i = 0; i < MAXCHARS; i++) {
+@@ -400,6 +387,14 @@
+
+ output = (char *)malloc(200 * sizeof(char));
+ timel = formatTime(&chr->ends);
++ old_umask = umask(0066);
++ tmp_fd = mkstemp(skillfile);
++ umask(old_umask);
++ if (tmp_fd == -1) {
++ error = strdup("Cannot create temporary file");
++ return error;
++ }
++ close(tmp_fd);
+ skill = getSkillname(skillfile, chr->skill);
+
+ chr->skillname = strdup(skill);