Skip to content

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

@adamqqqplay

Description

@adamqqqplay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions