pxar: change uid and gid to u32 instead of u64

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2019-08-02 15:19:35 +02:00 committed by Dietmar Maurer
parent 5e50c606b0
commit ead7546a96
3 changed files with 6 additions and 6 deletions

View File

@ -198,8 +198,8 @@ impl <'a, W: Write> Encoder<'a, W> {
let entry = PxarEntry { let entry = PxarEntry {
mode: mode, mode: mode,
flags: 0, flags: 0,
uid: stat.st_uid as u64, uid: stat.st_uid,
gid: stat.st_gid as u64, gid: stat.st_gid,
mtime: mtime as u64, mtime: mtime as u64,
}; };

View File

@ -51,8 +51,8 @@ pub struct PxarHeader {
pub struct PxarEntry { pub struct PxarEntry {
pub mode: u64, pub mode: u64,
pub flags: u64, pub flags: u64,
pub uid: u64, pub uid: u32,
pub gid: u64, pub gid: u32,
pub mtime: u64, pub mtime: u64,
} }

View File

@ -378,8 +378,8 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F
fn restore_ugid(&mut self, entry: &PxarEntry, fd: RawFd) -> Result<(), Error> { fn restore_ugid(&mut self, entry: &PxarEntry, fd: RawFd) -> Result<(), Error> {
let uid = entry.uid as u32; let uid = entry.uid;
let gid = entry.gid as u32; let gid = entry.gid;
let res = unsafe { libc::fchown(fd, uid, gid) }; let res = unsafe { libc::fchown(fd, uid, gid) };
Errno::result(res)?; Errno::result(res)?;