fix(multiarc/targz): handle GNUTYPE_LONGLINK for hard links with long…#3415
Open
Favorite6233 wants to merge 1 commit into
Open
fix(multiarc/targz): handle GNUTYPE_LONGLINK for hard links with long…#3415Favorite6233 wants to merge 1 commit into
Favorite6233 wants to merge 1 commit into
Conversation
… paths
TAR archives with hard links whose target path exceeds 100 characters
use a GNUTYPE_LONGLINK ('K') header block to store the full link name.
Previously this data was incorrectly stored in LongName (shared with
GNUTYPE_LONGNAME) and then applied to PathName instead of LinkName,
causing far2l to return GETARC_BROKEN when browsing such archives.
Changes:
- Add separate LongLink vector to store GNUTYPE_LONGLINK data
- Route GNUTYPE_LONGLINK records into LongLink instead of LongName
- Apply LongLink to Info->LinkName when present
- Clear LongName after use to prevent stale data leaking to next entry
- Handle PAX extended header 'linkpath' key alongside existing 'path'
- Remove TODO: GNUTYPE_LONGLINK comment
Fixes opening TAR archives containing hard links with paths > 100 chars.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix(multiarc/targz): handle GNUTYPE_LONGLINK for hard links with long paths
TAR archives with hard links whose target path exceeds 100 characters
use a GNUTYPE_LONGLINK ('K') header block to store the full link name.
Previously this data was incorrectly stored in LongName (shared with
GNUTYPE_LONGNAME) and then applied to PathName instead of LinkName,
causing far2l to return GETARC_BROKEN when browsing such archives.
Note: this fix applies to the built-in TAR parser in targz.cpp, which
is used when libarchive is unavailable. When libarchive is present,
far2l delegates TAR parsing to it and this code path is not used.
Changes:
Fixes opening TAR archives containing hard links with paths > 100 chars.
TAR-архивы, содержащие жёсткие ссылки (hard links) с длиной пути цели более 100 символов, использует специальный блок GNUTYPE_LONGLINK ('K') для хранения полного пути. Ранее этот блок обрабатывался так же, как GNUTYPE_LONGNAME — данные записывались в общую переменную LongName и затем применялись к PathName вместо LinkName. В результате при попытке открыть такой архив в far2l возвращался GETARC_BROKEN.
Примечание: исправление относится к встроенному парсеру TAR в targz.cpp, который используется когда libarchive недоступна. При наличии libarchive far2l делегирует разбор TAR этой библиотеке, и данный код не задействуется.
Изменения:
Проверено: архивы с жёсткими ссылками с длиной пути более 100 символов теперь корректно открываются в far2l.