From: Fabian Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com,
Wolfgang Bumiller <w.bumiller@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [pbs-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function
Date: Fri, 18 Jun 2021 09:07:50 +0200 [thread overview]
Message-ID: <b8fbf8a0-7590-1a86-e571-256768662311@proxmox.com> (raw)
In-Reply-To: <e92d6d39-574e-1ee3-9d02-5151f871edc5@proxmox.com>
Am 18.06.21 um 08:58 schrieb Fabian Ebner:
> Am 18.06.21 um 08:56 schrieb Wolfgang Bumiller:
>>
>>> On 06/18/2021 8:53 AM Fabian Ebner <f.ebner@proxmox.com> wrote:
>>>
>>> Am 18.06.21 um 08:44 schrieb Wolfgang Bumiller:
>>>>
>>>>> On 06/18/2021 8:42 AM Fabian Ebner <f.ebner@proxmox.com> wrote:
>>>>>>> + Some((last, rest)) => match rest.split_last() {
>>>>>>> + Some((second_to_last, _rest)) => {
>>>>>>> + (*last == "org" && *second_to_last == "debian")
>>>>>>> + || (*last == "com" && *second_to_last ==
>>>>>>> "proxmox")
>>>>>>> + }
>>>>>>> + None => false,
>>>>>>> + },
>>>>>>> + None => false,
>>>>>>> + };
>>>>>>> +
>>>>>>> + for uri in self.uris.iter() {
>>>>>>> + if let Some(host) = host_from_uri(uri) {
>>>>>>> + let domains = host.split('.').collect();
>>>>>>
>>>>>> ^ But instead of building a vector here, why not just do:
>>>>>>
>>>>>> if host == "proxmox.com" || host.ends_with(".proxmox.com")
>>>>>> || host == "debian.org" || host.ends_with(".debian.org")
>>>>>> {
>>>>>> ...
>>>>>> }
>>>>>>
>>>>>
>>>>> Misses FQDNs?
>>>>
>>>> Such as?
>>>>
>>>
>>> http://security.debian.org.
>>
>> Why is that not caught by `.ends_with(".debian.org")`?
>>
>
> Because of the final dot. But it is likely very uncommon and simply
> splitting by '.' leads to false results with e.g.
> http://security..debian.org too, so it might not be worth worrying about...
>
Sorry, should've been http://security.debian..org
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
WARNING: multiple messages have this Message-ID
From: Fabian Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com,
Wolfgang Bumiller <w.bumiller@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [pve-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function
Date: Fri, 18 Jun 2021 09:07:50 +0200 [thread overview]
Message-ID: <b8fbf8a0-7590-1a86-e571-256768662311@proxmox.com> (raw)
In-Reply-To: <e92d6d39-574e-1ee3-9d02-5151f871edc5@proxmox.com>
Am 18.06.21 um 08:58 schrieb Fabian Ebner:
> Am 18.06.21 um 08:56 schrieb Wolfgang Bumiller:
>>
>>> On 06/18/2021 8:53 AM Fabian Ebner <f.ebner@proxmox.com> wrote:
>>>
>>> Am 18.06.21 um 08:44 schrieb Wolfgang Bumiller:
>>>>
>>>>> On 06/18/2021 8:42 AM Fabian Ebner <f.ebner@proxmox.com> wrote:
>>>>>>> + Some((last, rest)) => match rest.split_last() {
>>>>>>> + Some((second_to_last, _rest)) => {
>>>>>>> + (*last == "org" && *second_to_last == "debian")
>>>>>>> + || (*last == "com" && *second_to_last ==
>>>>>>> "proxmox")
>>>>>>> + }
>>>>>>> + None => false,
>>>>>>> + },
>>>>>>> + None => false,
>>>>>>> + };
>>>>>>> +
>>>>>>> + for uri in self.uris.iter() {
>>>>>>> + if let Some(host) = host_from_uri(uri) {
>>>>>>> + let domains = host.split('.').collect();
>>>>>>
>>>>>> ^ But instead of building a vector here, why not just do:
>>>>>>
>>>>>> if host == "proxmox.com" || host.ends_with(".proxmox.com")
>>>>>> || host == "debian.org" || host.ends_with(".debian.org")
>>>>>> {
>>>>>> ...
>>>>>> }
>>>>>>
>>>>>
>>>>> Misses FQDNs?
>>>>
>>>> Such as?
>>>>
>>>
>>> http://security.debian.org.
>>
>> Why is that not caught by `.ends_with(".debian.org")`?
>>
>
> Because of the final dot. But it is likely very uncommon and simply
> splitting by '.' leads to false results with e.g.
> http://security..debian.org too, so it might not be worth worrying about...
>
Sorry, should've been http://security.debian..org
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
next prev parent reply other threads:[~2021-06-18 7:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 6:56 [pve-devel] " Wolfgang Bumiller
2021-06-18 6:56 ` [pbs-devel] " Wolfgang Bumiller
2021-06-18 6:58 ` Fabian Ebner
2021-06-18 6:58 ` [pbs-devel] " Fabian Ebner
2021-06-18 7:07 ` Fabian Ebner [this message]
2021-06-18 7:07 ` Fabian Ebner
2021-06-18 7:17 [pve-devel] [pbs-devel] " Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8fbf8a0-7590-1a86-e571-256768662311@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=w.bumiller@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.