Skip to content
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

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

Closed
adamqqqplay opened this issue Jul 17, 2023 · 0 comments · Fixed by #333
Closed

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

adamqqqplay opened this issue Jul 17, 2023 · 0 comments · Fixed by #333

Comments

@adamqqqplay
Copy link
Contributor

Details

Current code cannot handle very large UID/GID in PAX tar (>=2097151, limit of USTAR tar), mainly due to not reading values from PaxExtensions.

Reproduce

I have written a reproduce case in: https://github.com/adamqqqplay/tar-rs/tree/pax-large-uid-gid

Steps

git clone https://github.com/adamqqqplay/tar-rs
cd tar-rs
git checkout pax-large-uid-gid
./examples/pax/pax_build_tar.sh

sudo su
cargo run --package tar --example pax_untar

Results

This code throws an error because very large UIDs/GIDs cannot be read from the PAX extension.

[INFO] test tar file: ./examples/pax/biguid_gnu.tar
[INFO] uid and gid test success

[INFO] test tar file: ./examples/pax/biguid_pax.tar
thread 'main' panicked at 'assertion failed: (left == right)
left: 0,
right: 4294967294', examples/pax_untar.rs:47:13

adamqqqplay added a commit to adamqqqplay/tar-rs that referenced this issue Jul 17, 2023
Fix: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
adamqqqplay added a commit to adamqqqplay/tar-rs that referenced this issue Jul 17, 2023
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: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
adamqqqplay added a commit to adamqqqplay/tar-rs that referenced this issue Jul 17, 2023
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: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
adamqqqplay added a commit to adamqqqplay/tar-rs that referenced this issue Jul 18, 2023
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: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
adamqqqplay added a commit to adamqqqplay/tar-rs that referenced this issue Jul 18, 2023
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: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
alexcrichton pushed a commit that referenced this issue Aug 7, 2023
* refactor pax_extensions_size() to pax_extensions_value()

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

* make the handling of pax extensions more generic

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

* 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: #332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

---------

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
ararslan pushed a commit to ararslan/binstall-tar that referenced this issue Jun 6, 2024
…n#333)

* refactor pax_extensions_size() to pax_extensions_value()

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

* make the handling of pax extensions more generic

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

* 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: alexcrichton#332

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>

---------

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
(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 a pull request may close this issue.

1 participant