From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Bitsch To: development@lists.ipfire.org Subject: Re: [PATCH] general-functions.pl: Fix for bug#12937 Date: Wed, 28 Dec 2022 14:23:52 +0100 Message-ID: <8a647331-aa6a-177d-5308-b2e19a1a27a9@ipfire.org> In-Reply-To: <9474665A-E686-4CB4-95BF-AC512549A8B3@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8422951581544092105==" List-Id: --===============8422951581544092105== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, Am 28.12.2022 um 13:47 schrieb Michael Tremer: > Hello, >=20 > I am not entirely sure whether this is a change that I can approve of or no= t. >=20 >> On 19 Dec 2022, at 09:54, Adolf Belka 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 excl= uded 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-wildcar= d-in-wpad-excluded-url-s/8597 >> forum user has tested the patch change and confirmed it solves the prob= lem. >=20 > 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 i= t goes to squid.conf which uses a different syntax than wpad. >=20 > Users should have one universal language across the distribution and nothin= g else. I realise that we don=E2=80=99t do that too well, but at least on the= same page, we should have a unified syntax. >=20 > Instead, we should add an extra * if it is needed so that the user does not= have to mind. >=20 > Is that an option in this case? > 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. Just my opinion. Bernhard > -Michael >=20 >> >> 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 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 --===============8422951581544092105==--