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

Iterator File List for JAR Files When Looking for Class #14

Open
belugabehr opened this issue Dec 13, 2021 · 1 comment
Open

Iterator File List for JAR Files When Looking for Class #14

belugabehr opened this issue Dec 13, 2021 · 1 comment

Comments

@belugabehr
Copy link

belugabehr commented Dec 13, 2021

if grep -q JndiLookup.class $jarfile; then

I think it's more safe and proper to actually iterate the files in the JAR files instead of scanning through their binary contents:

 if unzip -l $jarfile | grep -q JndiLookup.class; then 

Should also be faster than the current implementation because the unzip utility knows how to quickly find the class names within the ZIP file dictionary without having to scan/read the entire file.

@belugabehr belugabehr changed the title Unzip JAR Files When Looking for Class Iterator File List for JAR Files When Looking for Class Dec 14, 2021
@jtran-cloudera
Copy link
Contributor

In testing, the grep was faster, but we will note the suggestion.

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