mtree: follow-up all type=dir entries with ".." #168
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the mtree(8) format, each directory entry is treated as a parent
entry for subsequent entries (which are then considered to be lexically
children of their parent when figuring out what paths to compare for
manifest verification).
'casync mtree' outputs a fairly unconventional "flat" version of the
mtree(8) format, and as a result didn't handle this correctly in the
past. The most trivial way of handling the type=dir problem is to negate
it after each entry with a ".." entry. Because this acts on the node
level, having nodes with names like "a/b/c" doesn't cause an issue.
This is necessary for compatibility with go-mtree. It should be noted
that this change is still not sufficient for compatibility with FreeBSD
mtree(8), which does not permit "/" characters in node names. Supporting
this would require us to make significant changes to how generation
works (because we'd need to output a hierarchy-friendly format which
would require some more housekeeping). This is a stop-gap solution to at
least end up with basic compatibility.
Fixes: #167 vbatts/go-mtree#146
Signed-off-by: Aleksa Sarai [email protected]