From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: [PATCH] general-functions.pl: Fix for bug#12937 Date: Wed, 28 Dec 2022 15:09:07 +0100 Message-ID: <764eb891-2c67-3cc5-5d4f-67b3407ebcae@ipfire.org> In-Reply-To: <8a647331-aa6a-177d-5308-b2e19a1a27a9@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7703148204287250213==" List-Id: --===============7703148204287250213== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hallo all, On 28/12/2022 14:23, Bernhard Bitsch wrote: > Hello, >=20 >=20 > 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=20 >> or not. >> >>> On 19 Dec 2022, at 09:54, Adolf Belka wrote: >>> - The check for validwildcarddomainname did not allow wildcards of=20 >>> the form >>> =C2=A0=C2=A0 *.ipfire.org* which is the example given on the proxy.cgi pa= ge for=20 >>> excluded url's >>> =C2=A0=C2=A0 for the wpad file. >>> - A forum user sufferred from this problem and the bug was raised for=20 >>> it. >>> =20 >>> https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-= in-wpad-excluded-url-s/8597 >>> =C2=A0=C2=A0 forum user has tested the patch change and confirmed it solv= es the=20 >>> problem. >> >> I find it a little bit less than optimal that a user has to consider=20 >> where this string goes that they enter. They should not really care=20 >> about whether it goes to squid.conf which uses a different syntax than=20 >> wpad. >> >> Users should have one universal language across the distribution and=20 >> nothing else. I realise that we don=E2=80=99t do that too well, but at lea= st=20 >> on the same page, we should have a unified syntax. >> >> Instead, we should add an extra * if it is needed so that the user=20 >> does not have to mind. >> >> Is that an option in this case? >> >=20 > I think this is right. I didn't bother about the usage, when suggesting=20 > the modified regular expression syntax. > The values ( language in theoretical terms of RE ) should be equal for=20 > 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 (=20 > general-functions.pl, header.pl, network.pl, ... ). This may be done by=20 > a general revision ( a great work ;) ) or by stepwise corrections during=20 > working on functionalities using these modules. >=20 > 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=20 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=20 else needs to pick up this bug and associated patch. Regards, Adolf. >=20 > Bernhard >=20 >> -Michael >> >>> >>> Fixes: Bug#12937 >>> Suggested-by: Bernhard Bitsch >>> Signed-off-by: Adolf Belka >>> --- >>> config/cfgroot/general-functions.pl | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/config/cfgroot/general-functions.pl=20 >>> 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 =3D shift; >>> >>> # Ignore any leading dots >>> - if ($domainname =3D~ m/^\*\.(.*)/) { >>> + if ($domainname =3D~ m/^\*\.([^\*]*)\*?/ >>> $domainname =3D $1; >>> } >>> >>> --=20 >>> 2.39.0 >>> >> --=20 Sent from my laptop --===============7703148204287250213==--