Репозиторий Sisyphus
Последнее обновление: 30 июня 2022 | Пакетов: 17500 | Посещений: 24467513
en ru br
Репозитории ALT
S:2.6.4-alt1
5.1: 2.4.5-alt2
4.1: 2.4.5-alt0.1.M41.1
4.0: 2.4.5-alt0.1.M40.1
3.0: 2.4.1-alt7
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: inn

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: inn-2.6.2-linelimit-1098.patch
Скачать


Author: Sergey Y. Afonin <asy@altlinux.org>
Date:   Sat Nov 24 20:41:06 2018 +0000
    RFC 5536 says: software MUST NOT generate (but MAY accept) header field
    lines of more than 998 octets.
    
    Some news clients break it. This hack increases the limit to 1098 octets.
diff --git a/inn/include/inn/options.h b/inn/include/inn/options.h
index d412e47..ebd4076 100644
--- a/inn/include/inn/options.h
+++ b/inn/include/inn/options.h
@@ -108,7 +108,7 @@ typedef unsigned long           ARTNUM;
 #define GROW_AMOUNT(x)          ((x) < 128 * 1024 ? (x) : 128 * 1024)
 
 /* The maximum length of a single header or body line, including CRLF. */
-#define MAXARTLINELENGTH        1000
+#define MAXARTLINELENGTH        1100
 
 /* String length of high/low watermark.  Currently for 32-bit article numbers. */
 #define ARTNUMPRINTSIZE         10
@@ -119,7 +119,7 @@ typedef unsigned long           ARTNUM;
 /* The size of a medium buffer.  It should be greater than MAXARTLINELENGTH
  * because it is sometimes used as a good guess at a buffer size for some
  * header parsing code.*/
-#define MED_BUFFER              1024
+#define MED_BUFFER              2048
 
 /* The size of a large buffer.  Free dynamically allocated buffers larger
    than this when we're done with them. */
diff --git a/inn/nnrpd/post.c b/inn/nnrpd/post.c
index dd6979e..b7daac1 100644
--- a/inn/nnrpd/post.c
+++ b/inn/nnrpd/post.c
@@ -179,8 +179,9 @@ NextHeader(char *p)
          * Therefore, the count takes it into account (+1, besides the
          * length (p-q+1) of the string). */
         if (p - q + 2 > MAXARTLINELENGTH) {
-            strlcpy(Error, "Header line too long",
-                    sizeof(Error));
+            snprintf(Error, sizeof(Error),
+                     "Header line too long, reached limit %lu bytes",
+                     p - q);
             return NULL;
         }
         /* Check if there is a continuation line for the header. */
diff --git a/inn/tests/data/articles/bad-long-cont b/inn/tests/data/articles/bad-long-cont
index e9e9b29..a4cef34 100644
--- a/inn/tests/data/articles/bad-long-cont
+++ b/inn/tests/data/articles/bad-long-cont
@@ -2,7 +2,7 @@ Path: news.example.com!not-for-mail
 Newsgroups: example.test
 Subject: Article with too long of a header
 T: Testing
-   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    Testing
 From: user@example.com
 Date: Sat, 06 Mar 2004 21:39:44 -0800
diff --git a/inn/tests/data/articles/bad-long-hdr b/inn/tests/data/articles/bad-long-hdr
index a133a63..bf13869 100644
--- a/inn/tests/data/articles/bad-long-hdr
+++ b/inn/tests/data/articles/bad-long-hdr
@@ -1,7 +1,7 @@
 Path: news.example.com!not-for-mail
 Newsgroups: example.test
 Subject: Article with too long of a header
-T: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 From: user@example.com
 Date: Sat, 06 Mar 2004 21:39:44 -0800
 Message-ID: <bad-long-header@example.com>
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin