Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex exprerssions not correctly formed!!! #63

Closed
WallyZambotti opened this issue Sep 27, 2020 · 4 comments
Closed

Regex exprerssions not correctly formed!!! #63

WallyZambotti opened this issue Sep 27, 2020 · 4 comments

Comments

@WallyZambotti
Copy link

WallyZambotti commented Sep 27, 2020

Given

rex_header_all = new Regex("(?:" + NATIVE_ARCH + """/|>)?linux-headers-[a-zA-Z0-9.\-_]*_all.deb""");
Where NATIVE_ARCH = 'arm64' and the expression equals:

(?:arm64/|>)?linux-headers-[a-zA-Z0-9.\-_]*_all.deb
Should not match the following :

&nbsp;&nbsp;<a href="amd64/linux-headers-5.8.12-050812_5.8.12-050812.202009261732_all.deb">amd64/linux-headers-5.8.12-050812_5.8.12-050812.202009261732_all.deb</a><br>

However it does!

Because arm64 does not equal amd64. Otherwise why bother explicitly providing NATIVE_ARCH?

@WallyZambotti
Copy link
Author

WallyZambotti commented Sep 27, 2020

This can be fixed by making the following two changes:

  1. In initialize_regex() Remove the '?' for 0 or 1 occurrences of NATIVE_ARCH

rex_header_all = new Regex("(?:" + NATIVE_ARCH + """/|>)?linux-headers-[a-zA-Z0-9.\-_]*_all.deb""");

replace for

rex_header_all = new Regex("(?:" + NATIVE_ARCH + """/|>)linux-headers-[a-zA-Z0-9.\-_]*_all.deb""");
Which then breaks load_cached_page() which insists on having '_all' headers.

2 In load_cached_page() remove the requirement for all headers

			// Not all architectures have '_all' headers. This would only allow amd64 to succeed

			if ((deb_header.length == 0) /* || (deb_header_all.length == 0) */ || (deb_image.length == 0)){
				mark_invalid();
			}

@bkw777
Copy link
Owner

bkw777 commented Sep 28, 2020

Thank you for this. I'll check it out.

@bkw777
Copy link
Owner

bkw777 commented Mar 11, 2023

I think the 0 or 1 instance of arch is because old kernel versions on the web site didn't have arch subdirectores, but later ones do. I'll try to test this with a forced/faked arch and see if I can see what you're describing.

@bkw777 bkw777 closed this as completed Apr 22, 2023
@bkw777 bkw777 reopened this Apr 25, 2023
@bkw777
Copy link
Owner

bkw777 commented Jun 29, 2023

Apparently no longer a problem. Testing in an arm64 vm and it's matching correctly.

@bkw777 bkw777 closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants