summaryrefslogtreecommitdiffstats
path: root/src/rfs_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-11-06 09:46:08 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-11-06 09:46:08 +0100
commit34da5767b6235158fe1d1e2a784a40dbb590f9db (patch)
tree6cb89049881d951c3adeb4e87edabdf75a5f6d56 /src/rfs_dir.c
parent7d15a16cb83c2719f136785898ed3c6dd415f824 (diff)
Don't depend on "struct stat" for storing information about files, this
fix inode truncation when compiled with cygwin
Diffstat (limited to 'src/rfs_dir.c')
-rw-r--r--src/rfs_dir.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/rfs_dir.c b/src/rfs_dir.c
index 74efbd3..81882df 100644
--- a/src/rfs_dir.c
+++ b/src/rfs_dir.c
@@ -449,11 +449,16 @@ static file_data_t *reiser_dir(disk_t *disk_car, const partition_t *partition, d
new_file->status=0;
new_file->prev=ls->current_file;
new_file->next=NULL;
- new_file->stat.st_size=entity->stat.st_size;
-#ifdef DJGPP
- new_file->file_size=entity->stat.st_size;
-#endif
- memcpy(&new_file->stat,&entity->stat,sizeof(new_file->stat));
+ new_file->st_ino=entity->stat.st_ino;
+ new_file->st_mode=entity->stat.st_mode;
+// new_file->st_nlink=entity->stat.st_nlink;
+ new_file->st_uid=entity->stat.st_uid;
+ new_file->st_gid=entity->stat.st_gid;
+ new_file->st_size=entity->stat.st_size;
+// new_file->st_blksize=entity->stat.st_blksize;
+ new_file->td_atime=entity->stat.st_atime;
+ new_file->td_mtime=entity->stat.st_mtime;
+ new_file->td_ctime=entity->stat.st_ctime;
reiserfs_object_free(entity);
if(ls->current_file)
ls->current_file->next=new_file;
@@ -543,8 +548,8 @@ static int reiser_copy(disk_t *disk_car, const partition_t *partition, dir_data_
#endif
reiserfs_file_close(in);
fclose(f_out);
- set_date(new_file, file->stat.st_atime, file->stat.st_mtime);
- set_mode(new_file, file->stat.st_mode);
+ set_date(new_file, file->td_atime, file->td_mtime);
+ set_mode(new_file, file->st_mode);
free(new_file);
return error;
}