Bug 12937

Summary: proxy.cgi: wildcard domains not accepted
Product: IPFire Reporter: Bernhard Bitsch <bbitsch>
Component: ---Assignee: Adolf Belka <adolf.belka>
Status: CLOSED FIXED QA Contact:
Severity: Minor Usability    
Priority: - Unknown - CC: adolf.belka, michael.tremer, p27m, peter.mueller
Version: 2   
Hardware: unspecified   
OS: Unspecified   
See Also: https://bugzilla.ipfire.org/show_bug.cgi?id=12925

Description Bernhard Bitsch 2022-09-20 11:05:43 UTC
The patch for proxy.cgi/general-functions.pl of #12925 isn't sufficient.
validwildcarddomainname() extracts the domain name as follows
# Ignore any leading dots
if ($domainname =~ m/^\*\.(.*)/) {
   $domainname = $1;
}

The match slurbs all characters after '*.'. Wildcards usually are of the form '*.ipfire.org*' ( see example in proxy page ).
Therefore the match should be
$domainname =~ m/^\*\.([^\*]*)/

see also https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597
Comment 1 Bernhard Bitsch 2022-09-20 12:28:48 UTC
The right match is

$domainname =~ m/^\*\.([^\*]*)\*?/
Comment 3 Adolf Belka 2022-12-19 09:17:03 UTC
Missed a couple of brackets off in the first version so v2 patch version submitted

https://lists.ipfire.org/pipermail/development/2022-December/015006.html
https://patchwork.ipfire.org/project/ipfire/patch/20221219091236.3427-1-adolf.belka@ipfire.org/
Comment 5 Adolf Belka 2023-02-06 14:22:39 UTC
Core Update 173 Testing has been released

https://blog.ipfire.org/post/ipfire-2-27-core-update-173-is-available-for-testing
Comment 6 Adolf Belka 2023-02-06 16:59:25 UTC
Checked the proxy.cgi file in my CU173 Testing updated system and it does not have the change in it.

Running grep on /var/log/pakfire/update-core-upgrade-173.log looking for proxy.cgi does not find any reference.
Comment 7 Peter Müller 2023-02-07 11:40:45 UTC
Thank you for flagging this. Indeed, I forgot to ship proxy.cgi, and have just added a patch for this, which should land in "master" soon.

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=7b7a1aac7107f89f1c8756d01ccdf70f06e41471
Comment 8 Adolf Belka 2023-02-10 19:55:07 UTC
Sorry @Peter, not sure why I said I had looked in proxy.cgi for the change. That is where the change is experienced but the change itself is in general-functions.pl

However general-functions.pl was also in the filelists/files directory but also didn't get updated.

I retested, with a new vm clone, doing the Core Update to 173 Testing with the latest updates in master. (Build: master/deb11b3f) but it didn't change. general-functions.pl was not updated.
Comment 9 Adolf Belka 2023-02-24 11:10:21 UTC
Checked with Development Build: master/a98b79f8 and can confirm that the fix has been implemented with the update to CU173 Testing

So change verified as implemented.