-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
InodeDelta comparison of FullType doesn't line up #146
Comments
example output
|
https://github.com/vbatts/go-mtree/blob/master/testdata/source.casync-mtree is an example of the mtree output |
After looking at this quite a bit, I've become convinced it's actually a |
Hmmm. I've looked at this again. While I was wrong to say the format is not valid, casync prints every entry as though it's a |
casync attempts to output all entries as a Full entry but for top-level directories, there is no "/" in the escaped pathname, resulting in the entry being treated as a Relative entry. As per the specification[1], this results in any subsequent Relative entries (such as top-level files) being treated as children of the directory which causes manifests produced by casync to fail. The simplest solution is to force all directories to be treated as Full entries by adding a dummy "/" to the end of the pathname. It's not necessary to do anything for top-level files because they do not affect the "current directory" during parsing. [1]: https://man.netbsd.org/mtree.5 Ref: vbatts/go-mtree#146 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
casync attempts to output all entries as a Full entry but for top-level directories, there is no "/" in the escaped pathname, resulting in the entry being treated as a Relative entry. As per the specification[1], this results in any subsequent Relative entries (such as top-level files) being treated as children of the directory which causes manifests produced by casync to fail. The simplest solution is to force all directories to be treated as Full entries by adding a dummy "/" to the end of the pathname. It's not necessary to do anything for top-level files because they do not affect the "current directory" during parsing. [1]: https://man.netbsd.org/mtree.5 Ref: vbatts/go-mtree#146 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
systemd/casync#267 should fix the casync side, and #188 fixes the core issues with FullType though I still am not sure what we should do in the multiple-entries-for-the-same-path case. At the moment we just use the attributes of the last one but I'm not sure if that's the behaviour BSD expects (the "spec" doesn't tell us the correct behaviour, but I suspect our current behaviour is correct). |
casync attempts to output all entries as a Full entry but for top-level entries, there is no "/" in the escaped pathname, resulting in the entry being treated as a Relative entry. As per the specification[1], this results in any subsequent Relative entries (such as top-level files) being treated as children of the directory which causes manifests produced by casync to fail. The simplest solution (and the one that "nmtree -C" does) is to prefix every path with "./". However, nmtree does not like "./." (internally it requires every entry referenced in an Full entry's path to already have been referenced in the spec) and so we have to special-case the "." path. [1]: https://man.netbsd.org/mtree.5 Ref: vbatts/go-mtree#146 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
#145 (comment)
gomtree -f <(casync mtree .)
is a good example of this.The output of casync parses just fine, but does not validate just fine.
cc @cyphar @poettering
The text was updated successfully, but these errors were encountered: