unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
       [not found] ` <20220329151234.93102C01684@vcs2.savannah.gnu.org>
@ 2022-03-29 15:55   ` Robert Pluim
  2022-03-30  9:18     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Pluim @ 2022-03-29 15:55 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

>>>>> On Tue, 29 Mar 2022 11:12:34 -0400 (EDT), Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> branch: master
    Lars> commit fbf2ed9a648d9c0f64519900acf1574d0d74692b
    Lars> Author: Lars Ingebrigtsen <larsi@gnus.org>
    Lars> Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Lars>     ipv6 addresses aren't suspicious
    
    Lars>     * lisp/international/textsec.el (textsec--ipvx-address-p): New
    Lars>     function.
    Lars>     (textsec-domain-suspicious-p): Use it to say that ipv6 addresses
    Lars>     aren't suspicious (bug#54624).
    Lars> ---
    Lars>  lisp/international/textsec.el            | 12 ++++++++++++
    Lars>  test/lisp/international/textsec-tests.el | 11 ++++++++++-
    Lars>  2 files changed, 22 insertions(+), 1 deletion(-)

    Lars> +(defun textsec--ipvx-address-p (domain)
    Lars> +  "Return non-nil if DOMAIN is an ipv4 or ipv6 address."
    Lars> +  (or (string-match-p "\\`\\([0-9]\\{1,3\\}\\.?\\)\\{1,4\\}\\'" domain)
    Lars> +      (let ((ipv6 "\\([0-9a-f]\\{0,4\\}:?\\)\\{1,8\\}"))
    Lars> +        ;; With brackets.
    Lars> +        (or (string-match-p (format "\\`\\[%s\\]\\'" ipv6) domain)
    Lars> +            ;; Without.
    Lars> +            (string-match-p (format "\\`%s\\'" ipv6) domain)))))
    Lars> +

(textsec--ipvx-address-p ":1") => 0

but ":1" is not a valid IPv4 nor IPv6 address.

Perhaps you could use `network-lookup-address-info' instead.

Robert
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
@ 2022-03-30  5:26 Pedro Andres Aranda Gutierrez
  2022-03-30  7:29 ` Robert Pluim
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-03-30  5:26 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]

Robert> but ":1" is not a valid IPv4 nor IPv6 address.

However "::1" is valid, as would be "FC01::33", The :: stands for all
zeros.
This for IPv6 _addresses_.

IPv6 _prefixes_ conform to ([0-9-a-fA-F]{1,4}:)+:/[0-9]+

Best,/PA
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 883 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  5:26 Re: master fbf2ed9a64: ipv6 addresses aren't suspicious Pedro Andres Aranda Gutierrez
@ 2022-03-30  7:29 ` Robert Pluim
  2022-03-30  8:56   ` Pedro Andres Aranda Gutierrez
  2022-03-30 11:38   ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Robert Pluim @ 2022-03-30  7:29 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel

>>>>> On Wed, 30 Mar 2022 07:26:50 +0200, Pedro Andres Aranda Gutierrez <paaguti@gmail.com> said:

    Robert> but ":1" is not a valid IPv4 nor IPv6 address.
    Pedro> However "::1" is valid, as would be "FC01::33", The :: stands for all
    Pedro> zeros.
    Pedro> This for IPv6 _addresses_.

I am aware of this :-)

    Pedro> IPv6 _prefixes_ conform to ([0-9-a-fA-F]{1,4}:)+:/[0-9]+

And this. Lars is checking for IP addresses here, not prefixes, hence
my suggestion to use `network-lookup-address-info' (which is a thin
veneer over getaddrinfo(3)).

Robert
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  7:29 ` Robert Pluim
@ 2022-03-30  8:56   ` Pedro Andres Aranda Gutierrez
  2022-03-30  8:56     ` Pedro Andres Aranda Gutierrez
  2022-03-30 11:38   ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-03-30  8:56 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

Lars> I am aware of this :-)
:-)) The teacher in me speaking ;-)

How reliable is network-lookup-address-info in a partability scenario?
(Just curious...)

/PA

On Wed, 30 Mar 2022 at 09:29, Robert Pluim <rpluim@gmail.com> wrote:

> >>>>> On Wed, 30 Mar 2022 07:26:50 +0200, Pedro Andres Aranda Gutierrez <
> paaguti@gmail.com> said:
>
>     Robert> but ":1" is not a valid IPv4 nor IPv6 address.
>     Pedro> However "::1" is valid, as would be "FC01::33", The :: stands
> for all
>     Pedro> zeros.
>     Pedro> This for IPv6 _addresses_.
>
> I am aware of this :-)
>
>     Pedro> IPv6 _prefixes_ conform to ([0-9-a-fA-F]{1,4}:)+:/[0-9]+
>
> And this. Lars is checking for IP addresses here, not prefixes, hence
> my suggestion to use `network-lookup-address-info' (which is a thin
> veneer over getaddrinfo(3)).
>
> Robert
> --
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 1818 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  8:56   ` Pedro Andres Aranda Gutierrez
@ 2022-03-30  8:56     ` Pedro Andres Aranda Gutierrez
  2022-03-30  9:09       ` Robert Pluim
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-03-30  8:56 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]

*portability*

On Wed, 30 Mar 2022 at 10:56, Pedro Andres Aranda Gutierrez <
paaguti@gmail.com> wrote:

> Lars> I am aware of this :-)
> :-)) The teacher in me speaking ;-)
>
> How reliable is network-lookup-address-info in a partability scenario?
> (Just curious...)
>
> /PA
>
> On Wed, 30 Mar 2022 at 09:29, Robert Pluim <rpluim@gmail.com> wrote:
>
>> >>>>> On Wed, 30 Mar 2022 07:26:50 +0200, Pedro Andres Aranda Gutierrez <
>> paaguti@gmail.com> said:
>>
>>     Robert> but ":1" is not a valid IPv4 nor IPv6 address.
>>     Pedro> However "::1" is valid, as would be "FC01::33", The :: stands
>> for all
>>     Pedro> zeros.
>>     Pedro> This for IPv6 _addresses_.
>>
>> I am aware of this :-)
>>
>>     Pedro> IPv6 _prefixes_ conform to ([0-9-a-fA-F]{1,4}:)+:/[0-9]+
>>
>> And this. Lars is checking for IP addresses here, not prefixes, hence
>> my suggestion to use `network-lookup-address-info' (which is a thin
>> veneer over getaddrinfo(3)).
>>
>> Robert
>> --
>>
>
>
> --
> Fragen sind nicht da um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> Headaches with a Juju log:
> unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
> a leader-deposed hook here, but we can't yet
>
>

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 2639 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  8:56     ` Pedro Andres Aranda Gutierrez
@ 2022-03-30  9:09       ` Robert Pluim
  2022-03-30 10:39         ` Po Lu
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Pluim @ 2022-03-30  9:09 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel

>>>>> On Wed, 30 Mar 2022 10:56:59 +0200, Pedro Andres Aranda Gutierrez <paaguti@gmail.com> said:

    Pedro> *portability*
    Pedro> On Wed, 30 Mar 2022 at 10:56, Pedro Andres Aranda Gutierrez <
    Pedro> paaguti@gmail.com> wrote:

    Lars> I am aware of this :-)
    >> :-)) The teacher in me speaking ;-)
    >>

BTW, Iʼm not Lars

    >> How reliable is network-lookup-address-info in a partability scenario?
    >> (Just curious...)

Itʼs guaranteed to be available, since it depends on getaddrinfo,
without which Emacs will not build.

Robert
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-29 15:55   ` Robert Pluim
@ 2022-03-30  9:18     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-30  9:18 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

> (textsec--ipvx-address-p ":1") => 0
>
> but ":1" is not a valid IPv4 nor IPv6 address.

The point here isn't to say whether a domain is valid -- it's to say
whether it's suspicious.  There's nothing particularly suspicious about
invalid domains.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  9:09       ` Robert Pluim
@ 2022-03-30 10:39         ` Po Lu
  2022-03-30 13:14           ` Robert Pluim
  0 siblings, 1 reply; 13+ messages in thread
From: Po Lu @ 2022-03-30 10:39 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Pedro Andres Aranda Gutierrez, emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

>     >> How reliable is network-lookup-address-info in a partability scenario?
>     >> (Just curious...)
>
> Itʼs guaranteed to be available, since it depends on getaddrinfo,
> without which Emacs will not build.

It doesn't seem to be present on MS-DOS, along with other subprocess
related functions.  And FWIW, I don't see a reason for textsec to not
work there.

The relevant code should probably be surrounded with (fboundp
'network-lookup-address-info).



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30  7:29 ` Robert Pluim
  2022-03-30  8:56   ` Pedro Andres Aranda Gutierrez
@ 2022-03-30 11:38   ` Eli Zaretskii
  2022-03-30 13:17     ` Robert Pluim
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2022-03-30 11:38 UTC (permalink / raw)
  To: Robert Pluim; +Cc: paaguti, emacs-devel

> From: Robert Pluim <rpluim@gmail.com>
> Date: Wed, 30 Mar 2022 09:29:33 +0200
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> Lars is checking for IP addresses here, not prefixes, hence
> my suggestion to use `network-lookup-address-info' (which is a thin
> veneer over getaddrinfo(3)).

Won't that hit the wire?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30 10:39         ` Po Lu
@ 2022-03-30 13:14           ` Robert Pluim
  2022-03-30 13:36             ` Po Lu
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Pluim @ 2022-03-30 13:14 UTC (permalink / raw)
  To: Po Lu; +Cc: Pedro Andres Aranda Gutierrez, emacs-devel

>>>>> On Wed, 30 Mar 2022 18:39:43 +0800, Po Lu <luangruo@yahoo.com> said:

    Po> Robert Pluim <rpluim@gmail.com> writes:
    >> >> How reliable is network-lookup-address-info in a partability scenario?
    >> >> (Just curious...)
    >> 
    >> Itʼs guaranteed to be available, since it depends on getaddrinfo,
    >> without which Emacs will not build.

    Po> It doesn't seem to be present on MS-DOS, along with other subprocess
    Po> related functions.  And FWIW, I don't see a reason for textsec to not
    Po> work there.

Without subprocess support thereʼs no network support, so what use
would textsec be?

    Po> The relevant code should probably be surrounded with (fboundp
    Po> 'network-lookup-address-info).

Which relevant code?

Robert
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30 11:38   ` Eli Zaretskii
@ 2022-03-30 13:17     ` Robert Pluim
  0 siblings, 0 replies; 13+ messages in thread
From: Robert Pluim @ 2022-03-30 13:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: paaguti, emacs-devel

>>>>> On Wed, 30 Mar 2022 14:38:06 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Date: Wed, 30 Mar 2022 09:29:33 +0200
    >> Cc: emacs-devel <emacs-devel@gnu.org>
    >> 
    >> Lars is checking for IP addresses here, not prefixes, hence
    >> my suggestion to use `network-lookup-address-info' (which is a thin
    >> veneer over getaddrinfo(3)).

    Eli> Won't that hit the wire?

Hmm, yes, if you pass it something that doesnʼt look like an IP
address. Maybe we should implement inet_pton in lisp instead.

Robert
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30 13:14           ` Robert Pluim
@ 2022-03-30 13:36             ` Po Lu
  2022-04-01  5:37               ` Pedro Andres Aranda Gutierrez
  0 siblings, 1 reply; 13+ messages in thread
From: Po Lu @ 2022-03-30 13:36 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Pedro Andres Aranda Gutierrez, emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

>     Po> It doesn't seem to be present on MS-DOS, along with other subprocess
>     Po> related functions.  And FWIW, I don't see a reason for textsec to not
>     Po> work there.
>
> Without subprocess support thereʼs no network support, so what use
> would textsec be?

Isn't textsec for all untrusted text, not just text downloaded from the
internet?  Also, that's not exactly true, since it's possible to run the
DJGPP port of wget inside a subprocess in Emacs.

>     Po> The relevant code should probably be surrounded with (fboundp
>     Po> 'network-lookup-address-info).
>
> Which relevant code?

The code which will use network-lookup-address-info to determine if
something is a valid IPv6 address, presumably.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: master fbf2ed9a64: ipv6 addresses aren't suspicious
  2022-03-30 13:36             ` Po Lu
@ 2022-04-01  5:37               ` Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 13+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-04-01  5:37 UTC (permalink / raw)
  To: Po Lu, Lars Ingebrigtsen; +Cc: Robert Pluim, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Anyhow, the trees didn't let me see the forest...
With so much IPv6 transition in my backpack, I forgot to check the IPv4
part and that is buggy....
Any 3 number digit greater than 255 will return non-nil and that is an
obviously not correct.

Best, /PA

On Wed, 30 Mar 2022 at 15:37, Po Lu <luangruo@yahoo.com> wrote:

> Robert Pluim <rpluim@gmail.com> writes:
>
> >     Po> It doesn't seem to be present on MS-DOS, along with other
> subprocess
> >     Po> related functions.  And FWIW, I don't see a reason for textsec
> to not
> >     Po> work there.
> >
> > Without subprocess support thereʼs no network support, so what use
> > would textsec be?
>
> Isn't textsec for all untrusted text, not just text downloaded from the
> internet?  Also, that's not exactly true, since it's possible to run the
> DJGPP port of wget inside a subprocess in Emacs.
>
> >     Po> The relevant code should probably be surrounded with (fboundp
> >     Po> 'network-lookup-address-info).
> >
> > Which relevant code?
>
> The code which will use network-lookup-address-info to determine if
> something is a valid IPv6 address, presumably.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 2126 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-04-01  5:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30  5:26 Re: master fbf2ed9a64: ipv6 addresses aren't suspicious Pedro Andres Aranda Gutierrez
2022-03-30  7:29 ` Robert Pluim
2022-03-30  8:56   ` Pedro Andres Aranda Gutierrez
2022-03-30  8:56     ` Pedro Andres Aranda Gutierrez
2022-03-30  9:09       ` Robert Pluim
2022-03-30 10:39         ` Po Lu
2022-03-30 13:14           ` Robert Pluim
2022-03-30 13:36             ` Po Lu
2022-04-01  5:37               ` Pedro Andres Aranda Gutierrez
2022-03-30 11:38   ` Eli Zaretskii
2022-03-30 13:17     ` Robert Pluim
     [not found] <164856675431.14395.6880987976231300914@vcs2.savannah.gnu.org>
     [not found] ` <20220329151234.93102C01684@vcs2.savannah.gnu.org>
2022-03-29 15:55   ` Robert Pluim
2022-03-30  9:18     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).