Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (b50721511a6776d355c1332caf6b603b70324030)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jeremy Blosser <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (b50721511a6776d355c1332caf6b603b70324030)
  • Date: Sat, 7 Apr 2007 03:41:26 -0500

GIT changes to master z-rejected grimoire by Jeremy Blosser
<jblosser-smgl AT firinn.org>:

z-mail/qmail/CONFIGURE | 5 +-
z-mail/qmail/HISTORY | 4 ++
z-mail/qmail/PRE_BUILD | 3 +
z-mail/qmail/patches/qmail-dns-patch | 63
+++++++++++++++++++++++++++++++++++
4 files changed, 73 insertions(+), 2 deletions(-)

New commits:
commit b50721511a6776d355c1332caf6b603b70324030
Author: Jeremy Blosser <jblosser-smgl AT firinn.org>
Commit: Jeremy Blosser <jblosser-smgl AT firinn.org>

qmail: Add oversize DNS patch.

diff --git a/z-mail/qmail/CONFIGURE b/z-mail/qmail/CONFIGURE
index 9a8dc4c..4aad3da 100755
--- a/z-mail/qmail/CONFIGURE
+++ b/z-mail/qmail/CONFIGURE
@@ -1,2 +1,3 @@
-config_query QMAIL_PATCH_QMAILQUEUE "Apply the qmailqueue patch?" n &&
-config_query QMAIL_PATCH_LOCALBIND "Apply the local-bind patch?" n
+config_query QMAIL_PATCH_QMAILQUEUE "Apply the qmailqueue patch?" n &&
+config_query QMAIL_PATCH_LOCALBIND "Apply the local-bind patch?" n &&
+config_query QMAIL_PATCH_OVERSIZEDNS "Apply the oversize DNS patch?" n
diff --git a/z-mail/qmail/HISTORY b/z-mail/qmail/HISTORY
index 8656f34..b9f5c5f 100644
--- a/z-mail/qmail/HISTORY
+++ b/z-mail/qmail/HISTORY
@@ -1,3 +1,7 @@
+2007-04-07 Jeremy Blosser <jblosser-smgl AT firinn.org>
+ * CONFIGURE, PRE_BUILD, patches/qmail-dns-patch: Add oversized DNS
+ response patch.
+
2007-04-01 Jeremy Blosser <jblosser-smgl AT firinn.org>
* CONFLICTS: Add.
* DEPENDS, PRE_BUILD, BUILD: Make groff dependency / man pages
diff --git a/z-mail/qmail/PRE_BUILD b/z-mail/qmail/PRE_BUILD
index 117a1ad..bac5961 100755
--- a/z-mail/qmail/PRE_BUILD
+++ b/z-mail/qmail/PRE_BUILD
@@ -7,6 +7,9 @@ fi &&
if [ "$QMAIL_PATCH_LOCALBIND" == "y" ]; then
patch -p0 <$SCRIPT_DIRECTORY/patches/local-bind
fi &&
+if [ "$QMAIL_PATCH_OVERSIZEDNS" == "y" ]; then
+ patch -p1 <$SCRIPT_DIRECTORY/patches/qmail-dns-patch
+fi &&

if ! is_depends_enabled $SPELL groff; then
sed -i -e '/auto_qmail,"man\//d' hier.c &&
diff --git a/z-mail/qmail/patches/qmail-dns-patch
b/z-mail/qmail/patches/qmail-dns-patch
new file mode 100644
index 0000000..60f7641
--- /dev/null
+++ b/z-mail/qmail/patches/qmail-dns-patch
@@ -0,0 +1,63 @@
+--- qmail-1.03/dns.c.103 Mon Aug 17 16:06:58 1998
++++ qmail-1.03/dns.c Wed Aug 26 16:28:56 1998
+@@ -21,10 +21,12 @@
+ static unsigned short getshort(c) unsigned char *c;
+ { unsigned short u; u = c[0]; return (u << 8) + c[1]; }
+
+-static union { HEADER hdr; unsigned char buf[PACKETSZ]; } response;
++static struct { unsigned char *buf; } response;
++static int responsebuflen = 0;
+ static int responselen;
+ static unsigned char *responseend;
+ static unsigned char *responsepos;
++static u_long saveresoptions;
+
+ static int numanswers;
+ static char name[MAXDNAME];
+@@ -45,18 +47,33 @@
+ errno = 0;
+ if (!stralloc_copy(&glue,domain)) return DNS_MEM;
+ if (!stralloc_0(&glue)) return DNS_MEM;
+- responselen = lookup(glue.s,C_IN,type,response.buf,sizeof(response));
++ if (!responsebuflen)
++ if (response.buf = (unsigned char *)alloc(PACKETSZ+1))
++ responsebuflen = PACKETSZ+1;
++ else return DNS_MEM;
++
++ responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
++ if ((responselen >= responsebuflen) ||
++ (responselen > 0 && (((HEADER *)response.buf)->tc)))
++ {
++ if (responsebuflen < 65536)
++ if (alloc_re(&response.buf, responsebuflen, 65536))
++ responsebuflen = 65536;
++ else return DNS_MEM;
++ saveresoptions = _res.options;
++ _res.options |= RES_USEVC;
++ responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
++ _res.options = saveresoptions;
++ }
+ if (responselen <= 0)
+ {
+ if (errno == ECONNREFUSED) return DNS_SOFT;
+ if (h_errno == TRY_AGAIN) return DNS_SOFT;
+ return DNS_HARD;
+ }
+- if (responselen >= sizeof(response))
+- responselen = sizeof(response);
+ responseend = response.buf + responselen;
+ responsepos = response.buf + sizeof(HEADER);
+- n = ntohs(response.hdr.qdcount);
++ n = ntohs(((HEADER *)response.buf)->qdcount);
+ while (n-- > 0)
+ {
+ i = dn_expand(response.buf,responseend,responsepos,name,MAXDNAME);
+@@ -66,7 +83,7 @@
+ if (i < QFIXEDSZ) return DNS_SOFT;
+ responsepos += QFIXEDSZ;
+ }
+- numanswers = ntohs(response.hdr.ancount);
++ numanswers = ntohs(((HEADER *)response.buf)->ancount);
+ return 0;
+ }
+



  • [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (b50721511a6776d355c1332caf6b603b70324030), Jeremy Blosser, 04/07/2007

Archive powered by MHonArc 2.6.24.

Top of Page