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

ExtensionService does not validate the content of addins files #1415

Open
CharliePoole opened this issue Jun 10, 2024 · 0 comments
Open

ExtensionService does not validate the content of addins files #1415

CharliePoole opened this issue Jun 10, 2024 · 0 comments
Labels

Comments

@CharliePoole
Copy link
Collaborator

Currently, we assume that every entry in the file, once blank lines and comments are removed, is either a pattern or a valid path. Patterns are expanded to paths while we are searching for extensions but paths are used directly.

Error handling for patterns seems pretty good: if no file is found matching it we log that fact but otherwise ignore it. For paths without wild cards, we throw if the directory or file is not found.

The error message given when a path is not found can be cryptic. For example, a file containing a comment in C# format (leading double slash) gave the message "Directory '' not found." Figuring this out took an inordinate amount of time, since the message didn't clearly point to the addins file.

Proposed resolution:

  1. Check each non-pattern (entries with without *) for validity as a path. If an invallid entry is found, throw an exception immediately so that the extension may be removed or the file fixed.
  2. Optionally, check each pattern as well by replacing each * with a valid name and validate that as a path. In this case, we may want to simply issue a warning, as the error won't necessarily lead to an exception. If possible, we should try to discriminate between errors which will cause an exception and those which will not.

Comments please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant