From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#54624: 29.0.50; textsec and ipv6 addresses Date: Mon, 04 Apr 2022 15:33:23 +0200 Message-ID: <87r16d6kik.fsf@gmail.com> References: <87ee2ehzh6.fsf@gnus.org> <13DB0609-9BEB-42E5-BF2E-B29638A7F3E1@acm.org> <87czhxgmdt.fsf@gnus.org> <871F72AF-D4A2-4C68-9FF8-AF290103E0EA@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3568"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 54624@debbugs.gnu.org, Aleksandr Vityazev To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 04 15:34:11 2022 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 1nbMqR-0000fg-2t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Apr 2022 15:34:11 +0200 Original-Received: from localhost ([::1]:49846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbMqP-0008UY-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Apr 2022 09:34:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbMqI-0008UP-Oe for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 09:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbMqI-0002uZ-Fx for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 09:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nbMqI-0004QK-Dd for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 09:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Apr 2022 13:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54624 X-GNU-PR-Package: emacs Original-Received: via spool by 54624-submit@debbugs.gnu.org id=B54624.164907921216967 (code B ref 54624); Mon, 04 Apr 2022 13:34:02 +0000 Original-Received: (at 54624) by debbugs.gnu.org; 4 Apr 2022 13:33:32 +0000 Original-Received: from localhost ([127.0.0.1]:50867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbMpn-0004Pa-Nz for submit@debbugs.gnu.org; Mon, 04 Apr 2022 09:33:31 -0400 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:46049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbMpm-0004PO-Kl for 54624@debbugs.gnu.org; Mon, 04 Apr 2022 09:33:31 -0400 Original-Received: by mail-wr1-f47.google.com with SMTP id w4so14490675wrg.12 for <54624@debbugs.gnu.org>; Mon, 04 Apr 2022 06:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=Xc4Jq+T/0PHEZIsB6RnsYbjiryh+Gzp6FHctM9rUT30=; b=Jh7n531QmQeRo4GYeaobliMfVyxZ70L+4KzIwRfM/igocF+ozP3Ft37mLUegcLcr4S XcNi/4iTFioJakzvUGnid+pj2M1EUbKXaH83xubWLIsj8JSs9s3AwCF9CKLFLZSb9+cc qzus97EM/Q5VArEnzXO4qMIZqjBBkRyf36JIEY2mLzPtVNi4UP5umCuu2SaPBunmT5th Ql3SLh7NXH0Gz4nyHE5QOr/xONnywJ6Pd7vs1+VYD0ceJppsSAasfJp095jk+Fmr3uXt ryGxIToEF7zI/dOcJC73wPhpEoaVM8q1dGI52A8+ZnAjPkUVfnfI7uDyJqTDyuQOyapg HXqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=Xc4Jq+T/0PHEZIsB6RnsYbjiryh+Gzp6FHctM9rUT30=; b=4GfRoUfuCdHB9zV4GbGy1RWI28O+pHoaC9s0wHMPLNrEdxO9gqv45YJ2V2Pi2tp+B7 mw1xwwfYnZsAmNMuutB0q7CfRMqQgVKdB+uUJtk0vVo03JJV4azHvm86e+uuTwvPt6+k FSm270M8fJxyHRyc/90z1t6TrMzdEU0h6oIzndCseulk4qZlk6c2I4ViCqpW7tE/la5E JYHozD7fdqdP3r9XPEImzluF6ZfrpvoQRBOiaycRV2DzS+Lylgdi1qwWRh+IixalBRE6 76G7/HgDZB9r6oU76KePR5Yj7vTNaLU916h6CQCU4ADmEhGWRtecxbWv/KZFk81bv0MP l+Aw== X-Gm-Message-State: AOAM5333aN/tOaCpGkH5hjXAEoyHjDU8RBOQt1zAxQj+BOodRz4J1jbQ GUoTf+Gh9XaJBl5icDHjmLE= X-Google-Smtp-Source: ABdhPJyUKdun3ywDOO5FUXXaU5JCBpNcvVpkkKnszR7pVTg3j9cfF6F+qhokwSADtFal8qEPBwv57g== X-Received: by 2002:a5d:5486:0:b0:206:40a:a796 with SMTP id h6-20020a5d5486000000b00206040aa796mr8478743wrv.314.1649079204528; Mon, 04 Apr 2022 06:33:24 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:63d3:852f:6a79:2aa0]) by smtp.gmail.com with ESMTPSA id b1-20020adfd1c1000000b002058537af75sm9821363wrd.104.2022.04.04.06.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 06:33:23 -0700 (PDT) In-Reply-To: <871F72AF-D4A2-4C68-9FF8-AF290103E0EA@acm.org> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Mon, 4 Apr 2022 14:48:37 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:229409 Archived-At: >>>>> On Mon, 4 Apr 2022 14:48:37 +0200, Mattias Engdeg=C3=A5rd said: Mattias> 4 apr. 2022 kl. 12.42 skrev Lars Ingebrigtsen : >> Fine by me, but addresses that are too long should be suspicious (to >> catch people obfuscating by doing things like 000000000000000127.0.0= .1 >> and similar). That's what I was intending to catch with the {} thin= gs >> without having to actually do the hard maths myself. :-) Mattias> I agree that is desirable. If a strict parse is impractical (n= ot sure if it is), what about something slightly stricter than what we curr= ent have? Here is a straw-man proposal: Mattias> (rx-let ((octet (or "0" (: (in "1-9") (? (in "0-9") (? (in= "0-9")))))) Mattias> (ipv4 (: octet (=3D 3 "." octet))) Mattias> (hextet (** 1 4 (in "0-9a-f"))) Mattias> (ipv6 (: (? "::") hextet (* ":" (? ":") hextet) Mattias> (? (or "::" (: ":" ipv4) ))))) Mattias> (rx bos (or ipv4 ipv6 (: "[" ipv6 "]")) eos)) Mattias> and don't forget to bind case-fold-search to nil while calling= string-match-p since IPv6 specifies lower-case hex digits. Mattias> And thanks to Andreas for reminding me about IPv6 allowing dot= ted quads as well. Or we just arrange it so that there=CA=BCs a primitive that maps to calling getaddrinfo(3) with AI_NUMERICHOST in the hints.ai_flags (but Lars' motivation here is 'not suspicious', not 'looks like a numeric IP address', so maybe not). Robert --=20