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
feat: support handle very large uid/gid in PAX style tar #333
Conversation
Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
32b2260
to
8e9e82d
Compare
src/archive.rs
Outdated
@@ -275,7 +275,7 @@ impl<'a, R: Read> Iterator for Entries<'a, R> { | |||
impl<'a> EntriesFields<'a> { | |||
fn next_entry_raw( | |||
&mut self, | |||
pax_size: Option<u64>, | |||
pax_extensions: &Option<Vec<u8>>, |
There was a problem hiding this comment.
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]>>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
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); |
There was a problem hiding this comment.
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);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
8e9e82d
to
c73e74b
Compare
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>
c73e74b
to
17f97d2
Compare
@alexcrichton Hi Alex, could you take a look when you have time? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@alexcrichton Thanks for your review! |
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