* [PATCH] general-functions.pl: Fix for bug#12937
@ 2022-12-19 8:54 Adolf Belka
2022-12-28 12:47 ` Michael Tremer
0 siblings, 1 reply; 4+ messages in thread
From: Adolf Belka @ 2022-12-19 8:54 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
- The check for validwildcarddomainname did not allow wildcards of the form
*.ipfire.org* which is the example given on the proxy.cgi page for excluded url's
for the wpad file.
- A forum user sufferred from this problem and the bug was raised for it.
https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597
forum user has tested the patch change and confirmed it solves the problem.
Fixes: Bug#12937
Suggested-by: Bernhard Bitsch <bbitsch(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
config/cfgroot/general-functions.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl
index 98bedb4b9..06c160e05 100644
--- a/config/cfgroot/general-functions.pl
+++ b/config/cfgroot/general-functions.pl
@@ -760,7 +760,7 @@ sub validwildcarddomainname($) {
my $domainname = shift;
# Ignore any leading dots
- if ($domainname =~ m/^\*\.(.*)/) {
+ if ($domainname =~ m/^\*\.([^\*]*)\*?/
$domainname = $1;
}
--
2.39.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] general-functions.pl: Fix for bug#12937
2022-12-19 8:54 [PATCH] general-functions.pl: Fix for bug#12937 Adolf Belka
@ 2022-12-28 12:47 ` Michael Tremer
2022-12-28 13:23 ` Bernhard Bitsch
0 siblings, 1 reply; 4+ messages in thread
From: Michael Tremer @ 2022-12-28 12:47 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]
Hello,
I am not entirely sure whether this is a change that I can approve of or not.
> On 19 Dec 2022, at 09:54, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
>
> - The check for validwildcarddomainname did not allow wildcards of the form
> *.ipfire.org* which is the example given on the proxy.cgi page for excluded url's
> for the wpad file.
> - A forum user sufferred from this problem and the bug was raised for it.
> https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597
> forum user has tested the patch change and confirmed it solves the problem.
I find it a little bit less than optimal that a user has to consider where this string goes that they enter. They should not really care about whether it goes to squid.conf which uses a different syntax than wpad.
Users should have one universal language across the distribution and nothing else. I realise that we don’t do that too well, but at least on the same page, we should have a unified syntax.
Instead, we should add an extra * if it is needed so that the user does not have to mind.
Is that an option in this case?
-Michael
>
> Fixes: Bug#12937
> Suggested-by: Bernhard Bitsch <bbitsch(a)ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
> ---
> config/cfgroot/general-functions.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl
> index 98bedb4b9..06c160e05 100644
> --- a/config/cfgroot/general-functions.pl
> +++ b/config/cfgroot/general-functions.pl
> @@ -760,7 +760,7 @@ sub validwildcarddomainname($) {
> my $domainname = shift;
>
> # Ignore any leading dots
> - if ($domainname =~ m/^\*\.(.*)/) {
> + if ($domainname =~ m/^\*\.([^\*]*)\*?/
> $domainname = $1;
> }
>
> --
> 2.39.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] general-functions.pl: Fix for bug#12937
2022-12-28 12:47 ` Michael Tremer
@ 2022-12-28 13:23 ` Bernhard Bitsch
2022-12-28 14:09 ` Adolf Belka
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Bitsch @ 2022-12-28 13:23 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 2583 bytes --]
Hello,
Am 28.12.2022 um 13:47 schrieb Michael Tremer:
> Hello,
>
> I am not entirely sure whether this is a change that I can approve of or not.
>
>> On 19 Dec 2022, at 09:54, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
>> - The check for validwildcarddomainname did not allow wildcards of the form
>> *.ipfire.org* which is the example given on the proxy.cgi page for excluded url's
>> for the wpad file.
>> - A forum user sufferred from this problem and the bug was raised for it.
>> https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597
>> forum user has tested the patch change and confirmed it solves the problem.
>
> I find it a little bit less than optimal that a user has to consider where this string goes that they enter. They should not really care about whether it goes to squid.conf which uses a different syntax than wpad.
>
> Users should have one universal language across the distribution and nothing else. I realise that we don’t do that too well, but at least on the same page, we should have a unified syntax.
>
> Instead, we should add an extra * if it is needed so that the user does not have to mind.
>
> Is that an option in this case?
>
I think this is right. I didn't bother about the usage, when suggesting
the modified regular expression syntax.
The values ( language in theoretical terms of RE ) should be equal for
all usages of domainnames.
I know this isn't true in our software (for other names, also).
I think it's time to review this collection of functions (
general-functions.pl, header.pl, network.pl, ... ). This may be done by
a general revision ( a great work ;) ) or by stepwise corrections during
working on functionalities using these modules.
Just my opinion.
Bernhard
> -Michael
>
>>
>> Fixes: Bug#12937
>> Suggested-by: Bernhard Bitsch <bbitsch(a)ipfire.org>
>> Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
>> ---
>> config/cfgroot/general-functions.pl | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl
>> index 98bedb4b9..06c160e05 100644
>> --- a/config/cfgroot/general-functions.pl
>> +++ b/config/cfgroot/general-functions.pl
>> @@ -760,7 +760,7 @@ sub validwildcarddomainname($) {
>> my $domainname = shift;
>>
>> # Ignore any leading dots
>> - if ($domainname =~ m/^\*\.(.*)/) {
>> + if ($domainname =~ m/^\*\.([^\*]*)\*?/
>> $domainname = $1;
>> }
>>
>> --
>> 2.39.0
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] general-functions.pl: Fix for bug#12937
2022-12-28 13:23 ` Bernhard Bitsch
@ 2022-12-28 14:09 ` Adolf Belka
0 siblings, 0 replies; 4+ messages in thread
From: Adolf Belka @ 2022-12-28 14:09 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 3290 bytes --]
Hallo all,
On 28/12/2022 14:23, Bernhard Bitsch wrote:
> Hello,
>
>
> Am 28.12.2022 um 13:47 schrieb Michael Tremer:
>> Hello,
>>
>> I am not entirely sure whether this is a change that I can approve of
>> or not.
>>
>>> On 19 Dec 2022, at 09:54, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
>>> - The check for validwildcarddomainname did not allow wildcards of
>>> the form
>>> *.ipfire.org* which is the example given on the proxy.cgi page for
>>> excluded url's
>>> for the wpad file.
>>> - A forum user sufferred from this problem and the bug was raised for
>>> it.
>>>
>>> https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597
>>> forum user has tested the patch change and confirmed it solves the
>>> problem.
>>
>> I find it a little bit less than optimal that a user has to consider
>> where this string goes that they enter. They should not really care
>> about whether it goes to squid.conf which uses a different syntax than
>> wpad.
>>
>> Users should have one universal language across the distribution and
>> nothing else. I realise that we don’t do that too well, but at least
>> on the same page, we should have a unified syntax.
>>
>> Instead, we should add an extra * if it is needed so that the user
>> does not have to mind.
>>
>> Is that an option in this case?
>>
>
> I think this is right. I didn't bother about the usage, when suggesting
> the modified regular expression syntax.
> The values ( language in theoretical terms of RE ) should be equal for
> all usages of domainnames.
> I know this isn't true in our software (for other names, also).
> I think it's time to review this collection of functions (
> general-functions.pl, header.pl, network.pl, ... ). This may be done by
> a general revision ( a great work ;) ) or by stepwise corrections during
> working on functionalities using these modules.
>
> Just my opinion.
So what do I need to do.
-Close the patch and wait for someone to do the larger fix to all functions.
- Just change this function but then what needs to be changed in it.
I am not familiar enough with Regular Expressions to know how to add an
extra * if it is needed so that the user does not have to do it.
Someone needs to help me with a suggestion about this or else someone
else needs to pick up this bug and associated patch.
Regards,
Adolf.
>
> Bernhard
>
>> -Michael
>>
>>>
>>> Fixes: Bug#12937
>>> Suggested-by: Bernhard Bitsch <bbitsch(a)ipfire.org>
>>> Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
>>> ---
>>> config/cfgroot/general-functions.pl | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/config/cfgroot/general-functions.pl
>>> b/config/cfgroot/general-functions.pl
>>> index 98bedb4b9..06c160e05 100644
>>> --- a/config/cfgroot/general-functions.pl
>>> +++ b/config/cfgroot/general-functions.pl
>>> @@ -760,7 +760,7 @@ sub validwildcarddomainname($) {
>>> my $domainname = shift;
>>>
>>> # Ignore any leading dots
>>> - if ($domainname =~ m/^\*\.(.*)/) {
>>> + if ($domainname =~ m/^\*\.([^\*]*)\*?/
>>> $domainname = $1;
>>> }
>>>
>>> --
>>> 2.39.0
>>>
>>
--
Sent from my laptop
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-28 14:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 8:54 [PATCH] general-functions.pl: Fix for bug#12937 Adolf Belka
2022-12-28 12:47 ` Michael Tremer
2022-12-28 13:23 ` Bernhard Bitsch
2022-12-28 14:09 ` Adolf Belka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox