|
|
|
|
@ -42,6 +42,8 @@
|
|
|
|
|
/* 64KiB is the minimum blksize to best minimize system call overhead. */
|
|
|
|
|
#define COPY_FILE_BUFLEN 65536
|
|
|
|
|
|
|
|
|
|
int uses_default_owner = 0;
|
|
|
|
|
|
|
|
|
|
static int ext2_file_type(unsigned int mode)
|
|
|
|
|
{
|
|
|
|
|
if (LINUX_S_ISREG(mode))
|
|
|
|
|
@ -120,10 +122,17 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
|
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inode.i_uid = st->st_uid;
|
|
|
|
|
ext2fs_set_i_uid_high(inode, st->st_uid >> 16);
|
|
|
|
|
inode.i_gid = st->st_gid;
|
|
|
|
|
ext2fs_set_i_gid_high(inode, st->st_gid >> 16);
|
|
|
|
|
if (uses_default_owner) {
|
|
|
|
|
inode.i_uid = 0;
|
|
|
|
|
ext2fs_set_i_uid_high(inode, 0);
|
|
|
|
|
inode.i_gid = 0;
|
|
|
|
|
ext2fs_set_i_gid_high(inode, 0);
|
|
|
|
|
} else {
|
|
|
|
|
inode.i_uid = st->st_uid;
|
|
|
|
|
ext2fs_set_i_uid_high(inode, st->st_uid >> 16);
|
|
|
|
|
inode.i_gid = st->st_gid;
|
|
|
|
|
ext2fs_set_i_gid_high(inode, st->st_gid >> 16);
|
|
|
|
|
}
|
|
|
|
|
inode.i_mode = (LINUX_S_IFMT & inode.i_mode) | (~S_IFMT & st->st_mode);
|
|
|
|
|
inode.i_atime = st->st_atime;
|
|
|
|
|
inode.i_mtime = st->st_mtime;
|
|
|
|
|
|