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

Don't use engine-module.txt as a possible metadata source for all modules #4646

Closed
keturn opened this issue May 3, 2021 · 0 comments · Fixed by #4722
Closed

Don't use engine-module.txt as a possible metadata source for all modules #4646

keturn opened this issue May 3, 2021 · 0 comments · Fixed by #4722
Labels
Category: Security Requests, Issues and Changes targeting security
Milestone

Comments

@keturn
Copy link
Member

keturn commented May 3, 2021

Map<String, ModuleMetadataLoader> mmlm = moduleFactory.getModuleMetadataLoaderMap();
mmlm.put(TerasologyConstants.MODULE_INFO_FILENAME.toString(), metadataReader);
mmlm.put("engine-module.txt", metadataReader); // FIXME: this should be *only* for engine-module.
// FIXME: …or maybe engine-module doesn't need a special filename anymore?

I imagine that engine has this unique engine-module.txt filename because it was loaded from a class.getResource call

try (Reader reader = new InputStreamReader(getClass().getResourceAsStream("/engine-module.txt"), TerasologyConstants.CHARSET)) {

instead of a filesystem API that opens a file in the root of a specific directory or archive.

So maybe it needed a name to distinguish it from a /module.txt file that might have been put there by anything else on the classpath?

but now that we've moved it to org/terasology/engine/ maybe that's enough of a qualifier that it could just be named module.txt again?

[☝ copied from a comment thread on #4622]

This isn't quite release-critical for a first gestalt-v7 release, but it would definitely be good to get done while we're still on the topic before moving down the roadmap to something else.

@keturn keturn added the Category: Security Requests, Issues and Changes targeting security label May 3, 2021
@keturn keturn added this to the v4.4.1 milestone May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Security Requests, Issues and Changes targeting security
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant