You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deep target file paths, or file paths that are more than one subdirectory deep (e.g. <dir1>/<dir2>/file) fail to download due to the targetRemotePath being built wrong when using consistent snapshots.
Root Cause
Current state of the code uses strings.Cut() to parse the directory name from the file name. This works for target files that are only one directory deep (<subdir>/file.ext) because strings.Cut() splits the string on the first occurrence of the separator.
For nested target file paths (<subdir1>/<subdir2>/file.ext) the targetRemotePath ends up being generated incorrectly since the first occurrence of / does not separate the directory from the file name.
When using consistent snapshots, this ends up making the path be <subdir1>/<hash>.<subdir2>/file.ext instead of <subdir1>/<subdir2>/<hash>.file.ext
The text was updated successfully, but these errors were encountered:
Issue
Deep target file paths, or file paths that are more than one subdirectory deep (e.g.
<dir1>/<dir2>/file
) fail to download due to thetargetRemotePath
being built wrong when using consistent snapshots.Root Cause
Current state of the code uses
strings.Cut()
to parse the directory name from the file name. This works for target files that are only one directory deep (<subdir>/file.ext
) becausestrings.Cut()
splits the string on the first occurrence of the separator.go-tuf/metadata/updater/updater.go
Lines 237 to 244 in b2e024a
For nested target file paths (
<subdir1>/<subdir2>/file.ext
) thetargetRemotePath
ends up being generated incorrectly since the first occurrence of/
does not separate the directory from the file name.When using consistent snapshots, this ends up making the path be
<subdir1>/<hash>.<subdir2>/file.ext
instead of<subdir1>/<subdir2>/<hash>.file.ext
The text was updated successfully, but these errors were encountered: