Message ID | 20221219085446.2304-1-adolf.belka@ipfire.org |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4NbD6p162bz3xkD for <patchwork@web04.haj.ipfire.org>; Mon, 19 Dec 2022 08:54:58 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NbD6m0cwTzhN; Mon, 19 Dec 2022 08:54:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NbD6l6PP6z2yZy; Mon, 19 Dec 2022 08:54:55 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4NbD6j6l00z2xG7 for <development@lists.ipfire.org>; Mon, 19 Dec 2022 08:54:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4NbD6j0J2kzLB; Mon, 19 Dec 2022 08:54:52 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1671440093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WF848C/NuTIWHJOB8948uAUxvZuw6QVQNt1Gle00NNo=; b=O8DOEVnqAqWEdDsw7FbJDdtB9G2ZNRjruSEpy1z6snYgqmxxOOk6yD6UtjcwpVaR8u08GJ 2QS5GyQZrA6x2dBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1671440093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WF848C/NuTIWHJOB8948uAUxvZuw6QVQNt1Gle00NNo=; b=N28qIVzELslOpzP3kbeElqyd/98uBVOFcrzNnPW4hRkifijYmuon+W5YPhxLJ4Trk/Sr4j 743xR+5auqIWAbwqw6NF/k1bUs50p9Ta7blcx5/hML8feE+7WW7looPyo9T4X7DIPpZOuB sH5MfCsd9ffUjieGgvp0EF6oimf2HZDWM1VXDfa4F56qcB6jF1/xgU1pkkMTKErTCg2cUg YaL1MvLRNdzedDX90WguGmrvnzMehQcISd3pzInsAwNAHYU0tTRIDrWOB686hWCIrxEuHe 4omNVOb9QdCPC/Mc++qnMrFmf/Qx54ziukMWQtlj7zMS6xtpNi+VXtttQJwOrw== From: Adolf Belka <adolf.belka@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] general-functions.pl: Fix for bug#12937 Date: Mon, 19 Dec 2022 09:54:46 +0100 Message-Id: <20221219085446.2304-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
general-functions.pl: Fix for bug#12937
|
|
Commit Message
Adolf Belka
Dec. 19, 2022, 8:54 a.m. UTC
- 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@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
config/cfgroot/general-functions.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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@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@ipfire.org> > Signed-off-by: Adolf Belka <adolf.belka@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 >
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@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@ipfire.org> >> Signed-off-by: Adolf Belka <adolf.belka@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 >> >
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@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@ipfire.org> >>> Signed-off-by: Adolf Belka <adolf.belka@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 >>> >>
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; }