* Re: [pve-devel] [pbs-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function
@ 2021-06-18 7:17 Wolfgang Bumiller
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2021-06-18 7:17 UTC (permalink / raw)
To: Fabian Ebner, pbs-devel, Proxmox VE development discussion
> On 06/18/2021 9:07 AM Fabian Ebner <f.ebner@proxmox.com> wrote:
>
>
> 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
I still can't navigate to that in my browser ;-)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [pbs-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function
2021-06-18 6:58 ` Fabian Ebner
@ 2021-06-18 7:07 ` Fabian Ebner
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Ebner @ 2021-06-18 7:07 UTC (permalink / raw)
To: pbs-devel, Wolfgang Bumiller, Proxmox VE development discussion
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-18 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 7:17 [pve-devel] [pbs-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function Wolfgang Bumiller
-- strict thread matches above, loose matches on Subject: below --
2021-06-18 6:56 [pve-devel] " Wolfgang Bumiller
2021-06-18 6:58 ` Fabian Ebner
2021-06-18 7:07 ` [pve-devel] [pbs-devel] " Fabian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox