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

[bug] digest validation only happening when specified #64

Closed
vbatts opened this issue Aug 11, 2016 · 5 comments
Closed

[bug] digest validation only happening when specified #64

vbatts opened this issue Aug 11, 2016 · 5 comments

Comments

@vbatts
Copy link
Owner

vbatts commented Aug 11, 2016

[vbatts@bananaboat] {master *} ~/containers$ gomtree -c -T ./fedora.tar -K sha512digest,nlink > fedora.mtree.tar
[vbatts@bananaboat] {master *} ~/containers$ gomtree -f ./fedor.tara.mtree -p ./fedora/
[vbatts@bananaboat] {master *} ~/containers$ echo "" >> fedora/etc/fstab 
[vbatts@bananaboat] {master *} ~/containers$ gomtree -f ./fedora.mtree.tar -p ./fedora/
"etc/fstab": keyword "size": expected 313; got 314
[vbatts@bananaboat] {master *} ~/containers$ gomtree -f ./fedora.mtree.tar -p ./fedora/ -k sha512digest
"etc/fstab": keyword "sha512digest": expected 84e7b670c534f3f7e595c5ad5825de555d0d09cd37fbdb94beeee1023d9a1b5ceeae75ae4d31d9d9a974017894aed7f0ca9e7d66d34cbc8c84efb19b264b8e54; got 0df9ed341b0fceecceadc91e54bff16559512a2a27a6988c5111d92f1004d4c28eae90f70ba4565563615cf45d3bab57a15f0546cdc3a7ca02a6f8c6257a2f3b

The sha512digest keyword is in the manifest, but only being checked against when specifically instructed to do so.

@imsteev
Copy link

imsteev commented Aug 11, 2016

need to make sure all keywords found in a manifest are evaluated, unless the caller uses the -k flag option to reduce keywords to check

@cyphar
Copy link
Contributor

cyphar commented Nov 2, 2016

This is something I was considering while writing in #48. The other issue is if we have -k set to something which doesn't already exist in the manifest. IMO we should be defaulting to the set of keywords in the spec rather than the Default{Tar,}Keywords if -f is set.

@vbatts
Copy link
Owner Author

vbatts commented Nov 2, 2016

fair. Perhaps we can use the logic from the -list-keywords flag to detect
keywords first.

On Tue, Nov 1, 2016 at 9:00 PM, Aleksa Sarai notifications@github.com
wrote:

This is something I was considering while writing in #48
#48. The other issue is if we
have -k set to something which doesn't already exist in the manifest. IMO
we should be defaulting to the set of keywords in the spec rather than the
Default{Tar,}Keywords.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#64 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEF6YTCOgapRhGszWtveIAs5p-o2w94ks5q5-DCgaJpZM4JiYmJ
.

@cyphar
Copy link
Contributor

cyphar commented Nov 2, 2016

I've done something like that in #48: https://github.com/vbatts/go-mtree/pull/48/files#diff-e8b2d04ec2884011801582c86d040d36R188. But I can make a new PR where we default to CollectUsedKeywords and then make modifications to the default as per usual?

@vbatts
Copy link
Owner Author

vbatts commented Nov 18, 2016

This was fixed by #92

@vbatts vbatts closed this as completed Nov 18, 2016
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

3 participants