From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#38937: [PROPOSED PATCH] dns-query now represents SOA integers as integers Date: Sat, 4 Jan 2020 19:05:57 -0800 Message-ID: <20200105030557.32565-1-eggert@cs.ucla.edu> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="239078"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Paul Eggert To: 38937@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 05 04:07:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1inwG0-001055-0V for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Jan 2020 04:07:12 +0100 Original-Received: from localhost ([::1]:38674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inwFy-00035F-9U for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jan 2020 22:07:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51499) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inwFr-000358-Oq for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:07:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inwFq-0001KP-5K for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:07:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1inwFq-0001Jh-1i for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1inwFp-0001fM-Ru for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2020 03:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38937 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15781935786348 (code B ref -1); Sun, 05 Jan 2020 03:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jan 2020 03:06:18 +0000 Original-Received: from localhost ([127.0.0.1]:43566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1inwF8-0001eK-EO for submit@debbugs.gnu.org; Sat, 04 Jan 2020 22:06:18 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1inwF5-0001eA-Ag for submit@debbugs.gnu.org; Sat, 04 Jan 2020 22:06:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inwF4-0002yt-4w for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:06:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inwF2-0007XE-CB for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:06:13 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57036) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inwF2-0007Ql-5X for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 22:06:12 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 23AEA16006A for ; Sat, 4 Jan 2020 19:06:10 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PJcnoVxixFcQ; Sat, 4 Jan 2020 19:06:09 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 540FF160068; Sat, 4 Jan 2020 19:06:09 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8XW5f82dDSMU; Sat, 4 Jan 2020 19:06:09 -0800 (PST) Original-Received: from day.example.com (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2B1FC160017; Sat, 4 Jan 2020 19:06:09 -0800 (PST) X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174184 Archived-At: * etc/NEWS: Mention this. * lisp/net/dns.el (dns-read-int32): Declare obsolete. Assume bignums. (dns-read-type): Represent SOA integers as integers, not strings. --- etc/NEWS | 5 +++++ lisp/net/dns.el | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d6cabf8e9e..204f6692bb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -42,6 +42,11 @@ applies, and please also update docstrings as needed. * Incompatible Lisp Changes in Emacs 28.1 +** dns-query now consistently uses Lisp integers to represent integers. +Formerly it made an exception for integer components of SOA records, +because SOA serial numbers can exceed fixnum ranges on 32-bit platforms. +Emacs now supports bignums so this old glitch is no longer needed. + * Lisp Changes in Emacs 28.1 diff --git a/lisp/net/dns.el b/lisp/net/dns.el index cefe0851f0..8fb1eb6567 100644 --- a/lisp/net/dns.el +++ b/lisp/net/dns.el @@ -258,10 +258,8 @@ dns-read (nreverse spec)))) (defun dns-read-int32 () - ;; Full 32 bit Integers can't be handled by 32-bit Emacsen. If we - ;; use floats, it works. - (format "%.0f" (+ (* (dns-read-bytes 1) 16777216.0) - (dns-read-bytes 3)))) + (declare (obsolete nil "28.1")) + (number-to-string (dns-read-bytes 4))) (defun dns-read-type (string type) (let ((buffer (current-buffer)) @@ -286,11 +284,11 @@ dns-read-type ((eq type 'SOA) (list (list 'mname (dns-read-name buffer)) (list 'rname (dns-read-name buffer)) - (list 'serial (dns-read-int32)) - (list 'refresh (dns-read-int32)) - (list 'retry (dns-read-int32)) - (list 'expire (dns-read-int32)) - (list 'minimum (dns-read-int32)))) + (list 'serial (dns-read-bytes 4)) + (list 'refresh (dns-read-bytes 4)) + (list 'retry (dns-read-bytes 4)) + (list 'expire (dns-read-bytes 4)) + (list 'minimum (dns-read-bytes 4)))) ((eq type 'SRV) (list (list 'priority (dns-read-bytes 2)) (list 'weight (dns-read-bytes 2)) -- 2.17.1