pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/news/leafnode



Module Name:    pkgsrc
Committed By:   micha
Date:           Tue Nov 10 12:03:59 UTC 2020

Modified Files:
        pkgsrc/news/leafnode: Makefile distinfo
Added Files:
        pkgsrc/news/leafnode/patches: patch-miscutil.c

Log Message:
news/leafnode: Backport patch from upcoming 1.11.12

Prevent stack overruns if /message.id contains filenames >= 1000.
Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 pkgsrc/news/leafnode/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/news/leafnode/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/news/leafnode/patches/patch-miscutil.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/news/leafnode/Makefile
diff -u pkgsrc/news/leafnode/Makefile:1.51 pkgsrc/news/leafnode/Makefile:1.52
--- pkgsrc/news/leafnode/Makefile:1.51  Sun Jan 26 05:26:26 2020
+++ pkgsrc/news/leafnode/Makefile       Tue Nov 10 12:03:59 2020
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.51 2020/01/26 05:26:26 rillig Exp $
+# $NetBSD: Makefile,v 1.52 2020/11/10 12:03:59 micha Exp $
 
 DISTNAME=              leafnode-1.11.11
+PKGREVISION=           1
 CATEGORIES=            news
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=leafnode/}
 EXTRACT_SUFX=          .tar.bz2

Index: pkgsrc/news/leafnode/distinfo
diff -u pkgsrc/news/leafnode/distinfo:1.20 pkgsrc/news/leafnode/distinfo:1.21
--- pkgsrc/news/leafnode/distinfo:1.20  Tue Sep  4 11:00:48 2018
+++ pkgsrc/news/leafnode/distinfo       Tue Nov 10 12:03:59 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2018/09/04 11:00:48 wiz Exp $
+$NetBSD: distinfo,v 1.21 2020/11/10 12:03:59 micha Exp $
 
 SHA1 (leafnode-1.11.11.tar.bz2) = 8e84358748a26ff147ea28120e8b42f5f6deb936
 RMD160 (leafnode-1.11.11.tar.bz2) = 78078216a49356250ff843044431a66a0b722ab7
@@ -6,4 +6,5 @@ SHA512 (leafnode-1.11.11.tar.bz2) = 3a47
 Size (leafnode-1.11.11.tar.bz2) = 500482 bytes
 SHA1 (patch-Makefile.in) = 5ca379bc986a971c27c3287559c7294f7a4e92de
 SHA1 (patch-checkpeerlocal.c) = a2754f43c6153ce2f781880ed5bac3b90e72954c
+SHA1 (patch-miscutil.c) = db32f666272c46e7b580d459094178631f275653
 SHA1 (patch-xoverutil.c) = eb7c181aa033a587f53d66cd4d05791c60f49a7c

Added files:

Index: pkgsrc/news/leafnode/patches/patch-miscutil.c
diff -u /dev/null pkgsrc/news/leafnode/patches/patch-miscutil.c:1.1
--- /dev/null   Tue Nov 10 12:03:59 2020
+++ pkgsrc/news/leafnode/patches/patch-miscutil.c       Tue Nov 10 12:03:59 2020
@@ -0,0 +1,44 @@
+$NetBSD: patch-miscutil.c,v 1.1 2020/11/10 12:03:59 micha Exp $
+
+Leafnode no longer trashes the stack if it, while scanning the message.id
+directory, finds a directory with an all-numeric name that is 1000 or higher.
+https://gitlab.com/leafnode-2/leafnode-1/-/commit/33e7e308d60d774b7f67c1a59851ce3718ed0355
+
+--- miscutil.c.orig    2013-06-10 18:16:31.000000000 +0000
++++ miscutil.c
+@@ -63,13 +63,16 @@ static const mode_t default_umask = 0002
+ struct xoverinfo *xoverinfo;
+ unsigned long xfirst, xlast;
+ 
++/* kludge around C89 const not being a compile-time constant */
++enum { hashsize = 1000 };
++
+ static int
+ createmsgiddir(void) {
+     mastr *dir = mastr_new(1024);
+     mastr *mid = mastr_new(1024);
+     DIR *d;
+     int rc = 0;
+-    int havedir[1000] = {0};
++    int havedir[hashsize] = {0};
+ 
+     mastr_vcat(dir, spooldir, "/message.id", NULL);
+     d = opendir(mastr_str(dir));
+@@ -84,7 +87,7 @@ createmsgiddir(void) {
+           t = de->d_name;
+           if (isdigit((unsigned char)*t)) {
+               u = strtoul(t, &e, 10);
+-              if (e > t)
++              if (e > t && u < hashsize)
+                   havedir[u] = 1;
+           }
+       }
+@@ -96,7 +99,7 @@ createmsgiddir(void) {
+       closedir(d);
+ 
+       /* create missing */
+-      for(u = 0; u < 1000; u++) {
++      for(u = 0; u < hashsize; u++) {
+           char b[4];
+ 
+           snprintf(b, sizeof(b), "%03lu", u);



Home | Main Index | Thread Index | Old Index