--- extundelete-0.2.4/src/extundelete.cc.orig 2014-12-24 14:00:40.401233636 +0100 +++ extundelete-0.2.4/src/extundelete.cc 2014-12-24 14:41:00.240755859 +0100 @@ -89,6 +89,7 @@ Important future enhancements: #include #include #include +#include /* GNU headers */ #ifndef HAVE_GETOPT_H @@ -1746,8 +1746,14 @@ errcode_t restore_inode(ext2_filsys fs, } tsize = fsize - rsize; if ((retval = truncate( (outputdir + fname2).c_str(), tsize)) == 0) { + struct timeval times[2]; + chmod((outputdir + fname2).c_str(),inode->i_mode); + lchown((outputdir + fname2).c_str(),inode->i_uid,inode->i_gid); + times[0].tv_sec=inode->i_atime; times[0].tv_usec=0; + times[1].tv_sec=inode->i_mtime; times[1].tv_usec=0; + utimes((outputdir + fname2).c_str(),times); Log::info << "Restored inode " << ino << " to file " - << (outputdir + fname2) << std::endl; + << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime)) << std::endl; retval = 0; } else { Log::warn << "Failed to restore inode " << ino << " to file "