From f0fdcd72c110b6f8e00c1abca6f732ec5b39ab66 Mon Sep 17 00:00:00 2001 From: Andrew Strong Date: Sun, 19 Jun 2011 23:13:42 -0500 Subject: network/leafnode: Included upstream patch for texpire Signed-off-by: Robby Workman --- network/leafnode/applyfilter_plugleak.diff | 37 ---------------------- network/leafnode/leafnode.SlackBuild | 8 +++-- network/leafnode/patches/applyfilter_plugleak.diff | 37 ++++++++++++++++++++++ network/leafnode/patches/sizeof_fix.diff | 12 +++++++ network/leafnode/patches/texpire_delete.diff | 21 ++++++++++++ network/leafnode/sizeof_fix.diff | 12 ------- 6 files changed, 75 insertions(+), 52 deletions(-) delete mode 100644 network/leafnode/applyfilter_plugleak.diff create mode 100644 network/leafnode/patches/applyfilter_plugleak.diff create mode 100644 network/leafnode/patches/sizeof_fix.diff create mode 100644 network/leafnode/patches/texpire_delete.diff delete mode 100644 network/leafnode/sizeof_fix.diff (limited to 'network') diff --git a/network/leafnode/applyfilter_plugleak.diff b/network/leafnode/applyfilter_plugleak.diff deleted file mode 100644 index 54274cb998..0000000000 --- a/network/leafnode/applyfilter_plugleak.diff +++ /dev/null @@ -1,37 +0,0 @@ ---- a/applyfilter.c -+++ b/applyfilter.c -@@ -71,14 +71,12 @@ static int applyfilter(const char *name, struct newsgroup *g, - unsigned long *kept, unsigned long *deleted) - { - static size_t lsize = MAXHEADERSIZE + 1; -- static char *l; -+ char *l; - struct stat st; - int score, fd; - struct utimbuf u; - unsigned long n; - -- l = (char *)critmalloc(lsize, "Space for article"); -- - if (stat(name, &st)) { - ln_log(LNLOG_SNOTICE, LNLOG_CARTICLE, - "cannot stat file \"%s\" in newsgroup %s: %m", -@@ -97,6 +95,8 @@ static int applyfilter(const char *name, struct newsgroup *g, - return 0; - } - -+ l = (char *)critmalloc(lsize, "Space for article"); -+ - if((fd = open(name, O_RDONLY)) >= 0) - { - int ret; -@@ -167,6 +167,9 @@ static int applyfilter(const char *name, struct newsgroup *g, - ln_log(LNLOG_SERR, LNLOG_CARTICLE, - "could not open file \"%s\" in newsgroup %s\n", - name, g->name); -+ -+ free(l); -+ - return 0; - } - diff --git a/network/leafnode/leafnode.SlackBuild b/network/leafnode/leafnode.SlackBuild index d485cba99e..e7b9b505c9 100644 --- a/network/leafnode/leafnode.SlackBuild +++ b/network/leafnode/leafnode.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=leafnode VERSION=2.0.0.alpha20081229a -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -70,9 +70,11 @@ find . \ -exec chmod 644 {} \; # Fix compiler error with recent gcc: -patch -p1 < $CWD/sizeof_fix.diff +patch -p1 < $CWD/patches/sizeof_fix.diff # Fix memory leak with applyfilter: -patch -p1 < $CWD/applyfilter_plugleak.diff +patch -p1 < $CWD/patches/applyfilter_plugleak.diff +# Don't delete articles when texpire -n -C MessID is run: +patch -p1 < $CWD/patches/texpire_delete.diff CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ diff --git a/network/leafnode/patches/applyfilter_plugleak.diff b/network/leafnode/patches/applyfilter_plugleak.diff new file mode 100644 index 0000000000..54274cb998 --- /dev/null +++ b/network/leafnode/patches/applyfilter_plugleak.diff @@ -0,0 +1,37 @@ +--- a/applyfilter.c ++++ b/applyfilter.c +@@ -71,14 +71,12 @@ static int applyfilter(const char *name, struct newsgroup *g, + unsigned long *kept, unsigned long *deleted) + { + static size_t lsize = MAXHEADERSIZE + 1; +- static char *l; ++ char *l; + struct stat st; + int score, fd; + struct utimbuf u; + unsigned long n; + +- l = (char *)critmalloc(lsize, "Space for article"); +- + if (stat(name, &st)) { + ln_log(LNLOG_SNOTICE, LNLOG_CARTICLE, + "cannot stat file \"%s\" in newsgroup %s: %m", +@@ -97,6 +95,8 @@ static int applyfilter(const char *name, struct newsgroup *g, + return 0; + } + ++ l = (char *)critmalloc(lsize, "Space for article"); ++ + if((fd = open(name, O_RDONLY)) >= 0) + { + int ret; +@@ -167,6 +167,9 @@ static int applyfilter(const char *name, struct newsgroup *g, + ln_log(LNLOG_SERR, LNLOG_CARTICLE, + "could not open file \"%s\" in newsgroup %s\n", + name, g->name); ++ ++ free(l); ++ + return 0; + } + diff --git a/network/leafnode/patches/sizeof_fix.diff b/network/leafnode/patches/sizeof_fix.diff new file mode 100644 index 0000000000..a5e519dfb0 --- /dev/null +++ b/network/leafnode/patches/sizeof_fix.diff @@ -0,0 +1,12 @@ +--- a/system.h 2008-12-29 22:24:30.000000000 +1100 ++++ b/system.h 2010-05-26 19:39:22.376358080 +1000 +@@ -20,9 +20,6 @@ + #include + #elif HAVE_STDINT_H + #include +-#elif sizeof(unsigned long) == 4 && sizeof(unsigned char) == 1 +-typedef unsigned long uint32_t; +-typedef unsigned char uint8_t; + #else + #error "I cannot figure how to define uint32_t and uint8_t." + #endif diff --git a/network/leafnode/patches/texpire_delete.diff b/network/leafnode/patches/texpire_delete.diff new file mode 100644 index 0000000000..9347a39e43 --- /dev/null +++ b/network/leafnode/patches/texpire_delete.diff @@ -0,0 +1,21 @@ +# commit f8c3b831ea2af3de9036c3dbebcff27fbfcfeec4 +# Author: Matthias Andree +# Date: Fri May 27 01:22:44 2011 +0200 +# +# Bugfix: don't delete articles when texpire -n -C MessID is run. +# +# Found by Paul Brooks. + +--- a/texpire.c ++++ b/texpire.c +@@ -1123,7 +1123,9 @@ main(int argc, char **argv) + while(optind < argc) { + if (verbose) + printf("Trying to remove %s...\n", argv[optind]); +- delete_article(argv[optind], "Remove", "Removed", 1); ++ if (!dryrun) { ++ delete_article(argv[optind], "Remove", "Removed", 1); ++ } + optind++; + } + break; diff --git a/network/leafnode/sizeof_fix.diff b/network/leafnode/sizeof_fix.diff deleted file mode 100644 index a5e519dfb0..0000000000 --- a/network/leafnode/sizeof_fix.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- a/system.h 2008-12-29 22:24:30.000000000 +1100 -+++ b/system.h 2010-05-26 19:39:22.376358080 +1000 -@@ -20,9 +20,6 @@ - #include - #elif HAVE_STDINT_H - #include --#elif sizeof(unsigned long) == 4 && sizeof(unsigned char) == 1 --typedef unsigned long uint32_t; --typedef unsigned char uint8_t; - #else - #error "I cannot figure how to define uint32_t and uint8_t." - #endif -- cgit v1.2.3