This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
I hit this when exporting Fedora Silverblue, there are some long symlinks in there. Depends: alexcrichton/tar-rs#273 Closes: ostreedev#162
Requires: alexcrichton/tar-rs#274 And I'll just copy/paste the commit message from there, lightly edited: In https://github.com/ostreedev/ostree we generate a cryptographic checksum over files and symlinks, and directories. ostree does not currently perform any canonicalization on symlinks; we'll respect and honor whatever bytes we're provided as input, and replicate that on the target. We're using the Rust tar crate to do tar serialization, which has so far worked fine...except, I hit this corner case: ``` [root@cosa-devsh ~]# rpm -qf /usr/lib/systemd/systemd-sysv-install chkconfig-1.13-2.el8.x86_64 [root@cosa-devsh ~]# ll /usr/lib/systemd/systemd-sysv-install lrwxrwxrwx. 2 root root 24 Nov 29 18:08 /usr/lib/systemd/systemd-sysv-install -> ../../..//sbin/chkconfig [root@cosa-devsh ~]# ``` But, using `set_link_name` to write the tarball, we end up with the canonicalized path `../../../sbin/chkconfig` - i.e. without the double `//`. This breaks the checksum. Now, I am a bit tempted to change ostree to do canonicalization. But even if we did, I'd need to *exactly* match what tar-rs is doing. (I may of course also try to change the rhel8 systemd package, but that's going to take a while to propagate and this corner case isn't the only one I'm sure)
OK there's a new tar 0.4.38 with my PRs! Because it conflicted, I'm rolling (And now that I look at this...honestly I regret not also adding |
jmarrero
approved these changes
Dec 15, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I'm getting the same error with below:
Does it mean I should wait for newer rpm-ostree ? |
Hi, yes - this fix should land in the next rpm-ostree release. There are automated builds from git main at https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/ You can also build from source of course. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Use new
append_link()
API to handle long symlinksI hit this when exporting Fedora Silverblue, there are some
long symlinks in there.
Depends: alexcrichton/tar-rs#273
Closes: #162
tar/export: Write symlink targets literally
Requires: alexcrichton/tar-rs#274
And I'll just copy/paste the commit message from there, lightly edited:
In https://github.com/ostreedev/ostree we generate a cryptographic
checksum over files and symlinks, and directories.
ostree does not currently perform any canonicalization on symlinks;
we'll respect and honor whatever bytes we're provided as input,
and replicate that on the target.
We're using the Rust tar crate to do tar serialization,
which has so far worked fine...except, I hit this corner case:
But, using
set_link_name
to write the tarball, we end up withthe canonicalized path
../../../sbin/chkconfig
- i.e. without thedouble
//
. This breaks the checksum.Now, I am a bit tempted to change ostree to do canonicalization. But
even if we did, I'd need to exactly match what tar-rs is doing.
(I may of course also try to change the rhel8 systemd package, but
that's going to take a while to propagate and this corner case isn't
the only one I'm sure)