From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs Subject: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows Date: Wed, 01 Apr 2020 23:55:12 +0900 Message-ID: References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="103877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO) Cc: 40343@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 01 16:56:31 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJen8-000Qvn-U3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Apr 2020 16:56:30 +0200 Original-Received: from localhost ([::1]:33206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJen7-0002bl-VK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Apr 2020 10:56:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37352) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJemi-0002HB-5r for bug-gnu-emacs@gnu.org; Wed, 01 Apr 2020 10:56:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJemg-0006qe-0L for bug-gnu-emacs@gnu.org; Wed, 01 Apr 2020 10:56:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJemf-0006qW-TP for bug-gnu-emacs@gnu.org; Wed, 01 Apr 2020 10:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJemf-000877-S6 for bug-gnu-emacs@gnu.org; Wed, 01 Apr 2020 10:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Apr 2020 14:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40343 X-GNU-PR-Package: emacs Original-Received: via spool by 40343-submit@debbugs.gnu.org id=B40343.158575292131056 (code B ref 40343); Wed, 01 Apr 2020 14:56:01 +0000 Original-Received: (at 40343) by debbugs.gnu.org; 1 Apr 2020 14:55:21 +0000 Original-Received: from localhost ([127.0.0.1]:38563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJem1-00084q-DC for submit@debbugs.gnu.org; Wed, 01 Apr 2020 10:55:21 -0400 Original-Received: from snd00006.auone-net.jp ([111.86.247.6]:25025 helo=dmta0009.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJelx-00084S-VF for 40343@debbugs.gnu.org; Wed, 01 Apr 2020 10:55:20 -0400 Original-Received: from kzhr.d1.dion.ne.jp by dmta0009.auone-net.jp with ESMTP id <20200401145512693.QMWG.46504.kzhr.d1.dion.ne.jp@dmta0009.auone-net.jp>; Wed, 1 Apr 2020 23:55:12 +0900 In-Reply-To: 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177946 Archived-At: > Kazuhiro> For example, when I tested on my standalone Debian (sid) bo= x, > Kazuhiro> evaluating the below code just after starting Emacs returns= annoying > Kazuhiro> result. >=20 > Kazuhiro> (progn > Kazuhiro> (require 'dns) > Kazuhiro> (dns-set-servers) > Kazuhiro> dns-servers) >=20 > -> ("c") >=20 > Yes, but the API exposed by dns.el is 'dns-query' (and maybe > 'dns-query-cached'). 'dns-set-servers' should probably be called > 'dns--set-servers' to indicate that it=CA=BCs an internal function. >=20 > Kazuhiro> We need to validate dns-servers's value to judge whether > Kazuhiro> dns-set-servers succeeded contorary docstring of dns-set-se= rvers, > Kazuhiro> which says dns-servers is non-nil when dns-set-servers succ= eeded. I > Kazuhiro> think docstring or actual behavior of dns-set-servers shoul= d be fixed. >=20 > See previous paragraph: it=CA=BCs an internal function. I don't understand what you mean by "it=CA=BCs an internal function". I don't think it is okay that internal functions don't behave as described in docstring. > Kazuhiro> I noticed another problem in dns.el. dns-query function re= turns > Kazuhiro> message's string ("No DNS server configuration found") when > Kazuhiro> dns-servers is nil. >=20 > Yes, it should probably return nil, and this is actually a valid > reason for why 'dns-set-servers' should set dns-servers to nil on > failure. Can you determine why it=CA=BCs failing on your Debian box? I tested on Debian box as below. 1. /etc/init.d/networking stop 2. remove nameserver entry from /etc/resolv.conf On such condition, nslookup program outputs as below > ;; connection timed out; no servers could be reached Here is code snippet communicating with nslookup in dns-set-servers. > (with-temp-buffer > (call-process "nslookup" nil t nil "localhost") > (goto-char (point-min)) > (re-search-forward > "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t) > (setq dns-servers (list (match-string 1)))) On the above condition, re-search-forward doesn't match anything. But next match-string is called unconditionally. As far as I tested, match-string's result when last search didn't match is undefined. it may return nil, string or raise an error. Additionally, even if match-string returns nil, dns-servers is never set to nil. It is set to (nil). --=20 Kazuhiro Ito