Skip to content

feat: support handle very large uid/gid in PAX style tar #333

Merged
alexcrichton merged 3 commits into
composefs:masterfrom
adam3q:fix-pax-uid-gid
Aug 7, 2023
Merged

feat: support handle very large uid/gid in PAX style tar #333
alexcrichton merged 3 commits into
composefs:masterfrom
adam3q:fix-pax-uid-gid

Conversation

@adam3q

@adam3q adam3q commented Jul 17, 2023

Copy link
Copy Markdown
Contributor

This commit add process to read large uid/gid from PAX extensions
to fix very large UIDs/GIDs (>=2097151, limit of USTAR tar) lost
in PAX style tar during unpack.

Fix: #332

@adam3q adam3q force-pushed the fix-pax-uid-gid branch from 32b2260 to 8e9e82d Compare July 17, 2023 11:55
Comment thread src/archive.rs Outdated
fn next_entry_raw(
&mut self,
pax_size: Option<u64>,
pax_extensions: &Option<Vec<u8>>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using pax_extensions: Option<&[u8]>>?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Comment thread src/archive.rs Outdated
let mut pax_gid: Option<u64> = None;
if let Some(pax_extensions_ref) = &pax_extensions {
pax_size = pax_extensions_value(pax_extensions_ref, PAX_SIZE);
pax_uid = pax_extensions_value(pax_extensions_ref, PAX_UID);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

if let Some(uid) = pax_extensions_value(pax_extensions_ref, PAX_UID) {
       header.set_uid(uid);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@adam3q adam3q force-pushed the fix-pax-uid-gid branch from 8e9e82d to c73e74b Compare July 18, 2023 07:09
This commit add process to read large uid/gid from PAX extensions
to fix very large UIDs/GIDs (>=2097151, limit of USTAR tar) lost
in PAX style tar during unpack.

Fix: composefs#332

Signed-off-by: Qinqi Qu <[email protected]>
@adam3q adam3q force-pushed the fix-pax-uid-gid branch from c73e74b to 17f97d2 Compare July 18, 2023 07:10
@adam3q

adam3q commented Jul 21, 2023

Copy link
Copy Markdown
Contributor Author

@alexcrichton Hi Alex, could you take a look when you have time? Thanks!

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@alexcrichton alexcrichton merged commit 1d37489 into composefs:master Aug 7, 2023
@adam3q

adam3q commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

@alexcrichton Thanks for your review!

ararslan pushed a commit to ararslan/binstall-tar that referenced this pull request Jun 6, 2024
* refactor pax_extensions_size() to pax_extensions_value()

Signed-off-by: Qinqi Qu <[email protected]>

* make the handling of pax extensions more generic

Signed-off-by: Qinqi Qu <[email protected]>

* feat: support handle very large uid/gid in PAX style tar

This commit add process to read large uid/gid from PAX extensions
to fix very large UIDs/GIDs (>=2097151, limit of USTAR tar) lost
in PAX style tar during unpack.

Fix: composefs#332

Signed-off-by: Qinqi Qu <[email protected]>

---------

Signed-off-by: Qinqi Qu <[email protected]>
(cherry picked from commit 1d37489)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not handle very large UID/GID in PAX style tar

3 participants