Skip to content

Conversation

@jakub-nt
Copy link
Contributor

No description provided.

jakub-nt added 2 commits June 25, 2025 18:18
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…xed crash on attempting to add a non-URL archive file

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
if to_add[0].endswith(SUPPORTED_ARCHIVES) or to_add[0].startswith(
SUPPORTED_URI_SCHEMES
):
if to_add[0].startswith(SUPPORTED_URI_SCHEMES):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not the check to see if it ends with one of the SUPPORTED_ARCHIVES still be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If to_add[0].endswith(SUPPORTED_ARCHIVES) is true then either to_add[0].startswith(SUPPORTED_URI_SCHEMES) is true and nothing has changed, or it's false and to_add[0] isn't a supported URL and the subsequent code has no capability to add a local archive file. Actually neither _add_using_url nor _add_modules have such capability, and it seems adding local archive files has simply never been supported (we could consider supporting it as a local version of adding an archive file by URL in the future).

@olehermanse olehermanse merged commit 46fd31a into cfengine:master Jun 27, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants