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

Enforce every files in the files/ subdirectory to be listed in extra-files #5013

Open
kit-ty-kate opened this issue Jan 20, 2022 · 4 comments

Comments

@kit-ty-kate
Copy link
Member

Currently that isn’t enforced. You can add any files (patches, …) to a package in a repository without checksums.
This should be enforced.

@hannesm
Copy link
Member

hannesm commented Jan 20, 2022

the reverse should as well be checked -- since this guarantee is atm not here, conex needs to jump through some hoops (instead of "just using the hash of the opam file as the single required checksum).

Is there anything that ensures directory traversal is not possible (i.e. are .. / / avoided / not followed?)

@kit-ty-kate
Copy link
Member Author

kit-ty-kate commented Jan 20, 2022

the reverse should as well be checked

I’m not sure what you mean by that. I’ve just tried and the reverse is enforced:

$ opam lint ./opam
error 53: Mismatching 'extra-files:' field: "some-non-existant-file"

Is there anything that ensures directory traversal is not possible (i.e. are .. / / avoided / not followed?)

As far as i can see from testing, yes. Also

(mismatching_extra_files <> []));
is a simple string compare so no disk access

@hannesm
Copy link
Member

hannesm commented Jan 20, 2022

@kit-ty-kate thanks, indeed I meant your "some-non-existent-file" case.

@rjbou
Copy link
Collaborator

rjbou commented Jan 24, 2022

to cite @AltGr

extra-files was introduced way after the files/ overlay, and first used internally (to check changes in these files) ; which is why it couldn't be made mandatory directly
but that could be changed now

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

No branches or pull requests

3 participants