---- a/src/extundelete.cc 2010-05-16 03:51:15.000000000 +0200
-+++ b/src/extundelete.cc 2012-01-01 15:54:07.000000000 +0100
+--- 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 <fcntl.h>
#include <unistd.h>
/* GNU headers */
#ifndef HAVE_GETOPT_H
-@@ -2532,8 +2533,14 @@ int restore_inode(ext2_filsys fs, ext2_f
-
- if(!flag) {
- if (truncate( (outputdir + fname2).c_str(), EXT2_I_SIZE(inode)) == 0) {
+@@ -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);
- std::cout << "Restored inode " << ino << " to file ";
-- std::cout << (outputdir + fname2) << std::endl;
-+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
+ 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 {
- std::cout << "Failed to restore inode " << ino << " to file ";
+ Log::warn << "Failed to restore inode " << ino << " to file "
-diff -urNp a/src/extundelete.cc b/src/extundelete.cc
---- a/src/extundelete.cc 2010-05-16 03:51:15.000000000 +0200
-+++ b/src/extundelete.cc 2012-01-01 22:51:46.000000000 +0100
-@@ -2556,6 +2556,23 @@ int restore_inode(ext2_filsys fs, ext2_f
+--- 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-25 01:29:09.076514586 +0100
+@@ -1777,6 +1777,23 @@ errcode_t restore_inode(ext2_filsys fs,
retval = EU_RESTORE_FAIL;
}
}
+ else if (LINUX_S_ISDIR(inode->i_mode)) {
-+ if(mkdir((outputdir2 + fname2).c_str(), 0700)) {
-+ 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);
-+ std::cout << "Restored inode " << ino << " as directory ";
-+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
-+ retval = 0;
-+ } else {
-+ std::cout << "Failed to restore inode " << ino << " as directory ";
-+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
-+ retval = EU_RESTORE_FAIL;
-+ }
++ if(mkdir((outputdir2 + fname2).c_str(), 0700)) {
++ 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);
++ std::cout << "Restored inode " << ino << " as directory ";
++ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
++ retval = 0;
++ } else {
++ std::cout << "Failed to restore inode " << ino << " as directory ";
++ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
++ retval = EU_RESTORE_FAIL;
++ }
+ }
else {
- std::cout << "Failed to restore inode " << ino << " to file ";
- std::cout << (outputdir + fname2) << ":";
+ Log::info << "extundelete identified inode " << ino << " as "
+ << (outputdir + fname2) << ":"
Summary: Recover deleted files from an ext3 or ext4 partition
Name: extundelete
-Version: 0.2.0
-Release: 2
+Version: 0.2.4
+Release: 1
License: GPL v2
Group: Applications/System
-Source0: http://dl.sourceforge.net/extundelete/%{name}-%{version}.tar.bz2
-# Source0-md5: 6dac74b12a747f133326ff7b81fceedd
+Source0: http://download.sourceforge.net/extundelete/%{name}-%{version}.tar.bz2
+# Source0-md5: 77e626ad31433680c0a222069295d2ca
URL: http://extundelete.sourceforge.net/
Patch0: %{name}-attrs.patch
Patch1: %{name}-dirs.patch