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

Panic when using dir_push_all #359

Closed
rbran opened this issue Nov 21, 2023 · 0 comments · Fixed by #360
Closed

Panic when using dir_push_all #359

rbran opened this issue Nov 21, 2023 · 0 comments · Fixed by #360
Labels
S-Add-To-Changelog Status: Fixed, just needs added to Changelog

Comments

@rbran
Copy link
Contributor

rbran commented Nov 21, 2023

Because the function FilesystemWriter::dir_push_all don't insert the uid/gid to the lookup table, this unwrap will create a panic because it will be unable to find the uid/gid after a FilesystemWriter::write is called.

PoC

fn test() {
    let mut writer = std::io::Cursor::new(vec![]);
    let mut fs = FilesystemWriter::default();
    let header = NodeHeader { permissions: 0, uid: 1, gid: 2, mtime: 3 };
    fs.push_dir_all("a/b/c/d/e/f/g", header).unwrap();
    fs.write(&mut writer).unwrap();
}
@wcampbell0x2a wcampbell0x2a added the S-Add-To-Changelog Status: Fixed, just needs added to Changelog label Nov 22, 2023
@wcampbell0x2a wcampbell0x2a reopened this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Add-To-Changelog Status: Fixed, just needs added to Changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants