Hello community, here is the log from the commit of package ext4magic for openSUSE:Factory checked in at 2013-06-05 11:50:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ext4magic (Old) and /work/SRC/openSUSE:Factory/.ext4magic.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ext4magic" Changes: -------- --- /work/SRC/openSUSE:Factory/ext4magic/ext4magic.changes 2012-03-29 13:51:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ext4magic.new/ext4magic.changes 2013-06-05 11:50:43.000000000 +0200 @@ -1,0 +2,8 @@ +Mon May 27 18:42:04 UTC 2013 - [email protected] + +- Update to version 0.3.1: + * Some minor bugs been fixed. + * Support for ecryptfs by Magic-function. +- Enable configure option "--enable-file-attr" (restore also file attributes). + +------------------------------------------------------------------- Old: ---- ext4magic-0.3.0.tar.gz New: ---- ext4magic-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ext4magic.spec ++++++ --- /var/tmp/diff_new_pack.nv05YV/_old 2013-06-05 11:50:44.000000000 +0200 +++ /var/tmp/diff_new_pack.nv05YV/_new 2013-06-05 11:50:44.000000000 +0200 @@ -1,6 +1,7 @@ # # spec file for package ext4magic # +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2012 [email protected] # # All modifications and additions to the file contributed by third parties @@ -11,25 +12,26 @@ # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: ext4magic -Version: 0.3.0 +Version: 0.3.1 Release: 0 -License: GPL-2.0+ Summary: Can help to recover deleted files on ext3/4 filesystems -Url: http://openfacts2.berlios.de/wikide/index.php/BerliosProject:Ext4magic +License: GPL-2.0+ Group: System/Filesystems -Source: ext4magic-%{version}.tar.gz +Url: http://openfacts2.berlios.de/wikide/index.php/BerliosProject:Ext4magic +Source0: http://downloads.sourceforge.net/%{name}.berlios/%{name}-%{version}.tar.gz -BuildRequires: libbz2-devel -BuildRequires: zlib-devel BuildRequires: file-devel BuildRequires: libblkid-devel +BuildRequires: libbz2-devel +BuildRequires: zlib-devel -%if 0%{suse_version} || 0%{?fedora_version} || 0%{?rhel_version} +%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} BuildRequires: libuuid-devel %else BuildRequires: uuid-devel @@ -44,20 +46,28 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -ext4magic is a small tool for Linux administration, it can help to recover accidentally deleted or overwritten files from an ext3 or ext4 file systems. Especially private computers often lack an adequate and reliable backup or the backup interval is too large lack of capacity. After some minor or major accidents console or script often arises the question, how can I just restore the deleted files back? +ext4magic is a small tool for Linux administration, it can help to recover +accidentally deleted or overwritten files from an ext3 or ext4 file systems. +Especially private computers often lack an adequate and reliable backup or the +backup interval is too large lack of capacity. After some minor or major +accidents console or script often arises the question, how can I just restore +the deleted files back? %prep %setup -q %build -%configure --enable-expert-mode -%{__make} %{?_smp_mflags} +%configure \ + --enable-file-attr \ + --enable-expert-mode +make %{?_smp_mflags} %install %{makeinstall} %files -%defattr(-,root,root) +%defattr(-,root,root,-) +%doc AUTHORS COPYING ChangeLog NEWS README TODO %{_sbindir}/ext4magic %{_mandir}/man8/ext4magic.8.gz ++++++ ext4magic-0.3.0.tar.gz -> ext4magic-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/ChangeLog new/ext4magic-0.3.1/ChangeLog --- old/ext4magic-0.3.0/ChangeLog 2012-02-20 17:54:27.000000000 +0100 +++ new/ext4magic-0.3.1/ChangeLog 2012-09-21 22:31:31.000000000 +0200 @@ -1,3 +1,7 @@ +0.3.1 Some minor bugs been fixed. + new : support for ecryptfs by Magic-function + + 0.3.0 switch to BETA status Some minor bugs been fixed. compiler warnings eliminated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/NEWS new/ext4magic-0.3.1/NEWS --- old/ext4magic-0.3.0/NEWS 2012-02-20 17:39:52.000000000 +0100 +++ new/ext4magic-0.3.1/NEWS 2012-09-21 22:32:33.000000000 +0200 @@ -1,3 +1,6 @@ +ext4magic 0.3.1 new : support for ecryptfs by Magic-function + + ext4magic 0.3.0 switch to BETA status Some minor bugs been fixed. compiler warnings eliminated English documentation translation is started diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/TODO new/ext4magic-0.3.1/TODO --- old/ext4magic-0.3.0/TODO 2012-02-20 17:52:15.000000000 +0100 +++ new/ext4magic-0.3.1/TODO 2012-04-07 20:58:15.000000000 +0200 @@ -3,16 +3,19 @@ - English documentation we working on it, but we need help !!!!!!! http://openfacts2.berlios.de/wikien/index.php/BerliosProject:Ext4magic + Current stat 04.2012: not ready but looks good - support for ecrypfs in the Magic-function is particularly interesting for Ubuntu user + Current stat 04.2012: ready for test - the new Magic-function for ext3 old 0.2.x function is very slow and inaccurate and is not compatible with the Magic-functions of the ext4 in 0.3.x a support for both file systems is planned with 0.4.x + Current stat 04.2012: open - better support for source code and other text files @@ -25,6 +28,8 @@ # sed '1,/^$/d' ext4magic.c | file -i - /dev/stdin: text/x-c; charset=us-ascii + Current stat 04.2012: The current libmagic-5.11 eliminated the problem. + Changes within ext4magic therefore, not required - ext4 : with the Magic-function it should be possible to recover also some file types @@ -32,7 +37,7 @@ the conditions and preparations are already included the possible individual extents are already collected in the database a function is needed to find out and check the correct order - + Current stat 04.2012: open Currently known issues diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/configure new/ext4magic-0.3.1/configure --- old/ext4magic-0.3.0/configure 2012-02-19 11:48:32.000000000 +0100 +++ new/ext4magic-0.3.1/configure 2012-09-21 22:39:29.000000000 +0200 @@ -2497,7 +2497,7 @@ # Define the identity of the package. PACKAGE=ext4magic - VERSION=0.3.0 + VERSION=0.3.1 cat >>confdefs.h <<_ACEOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/configure.in new/ext4magic-0.3.1/configure.in --- old/ext4magic-0.3.0/configure.in 2012-02-19 11:47:28.000000000 +0100 +++ new/ext4magic-0.3.1/configure.in 2012-09-21 22:38:34.000000000 +0200 @@ -2,7 +2,7 @@ AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(ext4magic, 0.3.0) +AM_INIT_AUTOMAKE(ext4magic, 0.3.1) AC_LANG_C AC_PROG_CC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/src/ext4magic.c new/ext4magic-0.3.1/src/ext4magic.c --- old/ext4magic-0.3.0/src/ext4magic.c 2012-02-20 03:12:20.000000000 +0100 +++ new/ext4magic-0.3.1/src/ext4magic.c 2012-09-21 20:32:54.000000000 +0200 @@ -340,7 +340,7 @@ const char *usage = "\next4magic -M [-j <journal_file>] [-d <target_dir>] <filesystem> \n\ ext4magic -m [-j <journal_file>] [-d <target_dir>] <filesystem> \n\ ext4magic [-S|-J|-H|-V|-T] [-x] [-j <journal_file>] [-B n|-I n|-f <file_name>|-i <input_list>] [-t n|[[-a n][-b n]]] [-d <target_dir>] [-R|-r|-L|-l] [-Q] <filesystem>"; -int c; +int l,c ; int open_flags = EXT2_FLAG_SOFTSUPP_FEATURES; int recovermodus = 0 ; int disaster = 0; @@ -584,7 +584,8 @@ } mode |= COMMAND_INODE ; mode |= COMMAND_PATHNAME ; - pathname = malloc(512); + l = strlen(optarg); + pathname = malloc( l+1 ); strcpy(pathname,optarg); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/src/file_type.c new/ext4magic-0.3.1/src/file_type.c --- old/ext4magic-0.3.0/src/file_type.c 2012-02-19 12:24:17.000000000 +0100 +++ new/ext4magic-0.3.1/src/file_type.c 2012-04-07 18:02:19.000000000 +0200 @@ -55,7 +55,7 @@ char applistr[] ="dicom mac-binhex40 msword octet-stream ogg pdf pgp pgp-encrypted pgp-keys pgp-signature postscript unknown+zip vnd.google-earth.kml+xml vnd.google-earth.kmz vnd.lotus-wordpro vnd.ms-cab-compressed vnd.ms-excel vnd.ms-tnef vnd.oasis.opendocument. vnd.rn-realmedia vnd.symbian.install x-123 x-adrift x-archive x-arc x-arj x-bittorrent x-bzip2 x-compress x-coredump x-cpio x-dbf x-dbm x-debian-package x-dosexec x-dvi x-eet x-elc x-executable x-gdbm x-gnucash x-gnumeric x-gnupg-keyring x-gzip x-hdf x-hwp x-ichitaro4 x-ichitaro5 x-ichitaro6 x-iso9660-image x-java-applet x-java-jce-keystore x-java-keystore x-java-pack200 x-kdelnk x-lha x-lharc x-lzip x-mif xml xml-sitemap x-msaccess x-ms-reader x-object x-pgp-keyring x-quark-xpress-3 x-quicktime-player x-rar x-rpm x-sc x-setupscript x-sharedlib x-shockwave-flash x-stuffit x-svr4-package x-tar x-tex-tfm x-tokyocabinet-btree x-tokyocabinet-fixed x-tokyocabinet-hash x-tokyocabinet-table x-xz x-zoo zip x-font-ttf x-7z-compressed "; char textstr[] = "html PGP rtf texmacs troff vnd.graphviz x-awk x-diff x-fortran x-gawk x-info x-lisp x-lua x-msdos-batch x-nawk x-perl x-php x-shellscript x-texinfo x-tex x-vcard x-xmcd plain x-pascal x-c++ x-c x-mail x-makefile x-asm x-python x-java PEM SGML libtool M3U tcl POD PPD configure ruby sed expect ssh text "; //Files not found as mime-type - char undefstr[] ="MPEG Targa 7-zip cpio CD-ROM DVD 9660 Kernel boot ext2 ext3 ext4 Image Composite SQLite OpenOffice.org Microsoft VMWare3 VMware4 JPEG ART PCX RIFF DIF IFF ATSC ScreamTracker EBML LZMA Audio=Visual Sample=Vision ISO=Media Linux filesystem x86 LUKS python ESRI=Shape CDF "; + char undefstr[] ="MPEG Targa 7-zip cpio CD-ROM DVD 9660 Kernel boot ext2 ext3 ext4 Image Composite SQLite OpenOffice.org Microsoft VMWare3 VMware4 JPEG ART PCX RIFF DIF IFF ATSC ScreamTracker EBML LZMA Audio=Visual Sample=Vision ISO=Media Linux filesystem x86 LUKS python ESRI=Shape CDF ecryptfs "; //----------------------------------------------------------------------------------- char* p_search; char token[30]; @@ -7005,6 +7005,63 @@ return ret; } +//file_ecryptfs +int file_ecryptfs(unsigned char *buf, int *size, __u32 scan , int flag, struct found_data_t* f_data){ + int ret = 0; + __u32 blz,count; + __u64 lsize,ssize; + + + switch (flag){ + case 0: + if (f_data->size || f_data->h_size) { + if (f_data->scantype & DATA_METABLOCK){ + f_data->inode->i_size_high = f_data->h_size; + f_data->inode->i_size = f_data->size; + *size = current_fs->blocksize; + ret = 1; + } + else { + lsize = (__u64)f_data->h_size << 32; + lsize += f_data->size; + ssize = (__u64)f_data->inode->i_size_high << 32; + ssize += f_data->inode->i_size; + if (lsize > ssize) + ret = 0; + else{ + f_data->inode->i_size = f_data->size; + *size = current_fs->blocksize; + ret = 1; + } + } + } + break; + case 1: + return (scan & (M_IS_META | M_CLASS_1 | M_BLANK | M_TXT)) ? 0 : 1 ; + break; + case 2: + lsize = ((__u64)buf[0]<<56)+((__u64)buf[1]<<48)+((__u64)buf[2]<<40)+((__u64)buf[3]<<32)+ + (buf[4]<<24)+(buf[5]<<16)+(buf[6]<<8)+buf[7]; + blz = (buf[20]<<24)+(buf[21]<<16)+(buf[22]<<8)+buf[23]; + count = (buf[24]<<8)+buf[25]; + if (!(blz & 0x3ff)){ + // if (!lsize) lsize++; + lsize += (blz *count); + + f_data->size = lsize & 0xFFFFFFFF; + f_data->size = (f_data->size + (blz-1)) & (~(blz-1)); + f_data->h_size = lsize >> 32; + f_data->scantype = DATA_LENGTH; + ret =1; + } + break; + } + return ret; +} + + + + static int follow_ac3(unsigned char *buf, __u16 blockcount, __u32 *offset, __u32 *last_match, int flag){ static const __u16 tab[38][3] = { @@ -8691,6 +8748,11 @@ this->func = file_CDF ; strncat(this->name,".doc",7); break; + + case 0x0828 : //ecryptfs + this->func = file_ecryptfs ; + strncat(this->name,".ecrypt",8); + break; //---------------------------------------------------------------- default: this->func = file_default ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/src/inode.c new/ext4magic-0.3.1/src/inode.c --- old/ext4magic-0.3.0/src/inode.c 2012-02-19 12:24:16.000000000 +0100 +++ new/ext4magic-0.3.1/src/inode.c 2012-09-21 00:32:45.000000000 +0200 @@ -745,6 +745,18 @@ #endif continue; } +//Correct d_time anomalies if directory delete process not completed BUG: #18730 + if ((LINUX_S_ISDIR(ext2fs_le16_to_cpu(inode_pointer->i_mode))) && + ext2fs_le32_to_cpu(inode_pointer->i_dtime) && ext2fs_le32_to_cpu(inode_pointer->i_blocks) && + ext2fs_le32_to_cpu(inode_pointer->i_size) && (!ext2fs_le16_to_cpu(inode_pointer->i_links_count)) && + ext2fs_le32_to_cpu(inode_pointer->i_ctime) != ext2fs_le32_to_cpu(inode_pointer->i_dtime)){ + if ( buf->count && LINUX_S_ISDIR(item->inode->i_mode) && item->inode->i_blocks){ + continue; + } + else{ + inode_pointer->i_dtime = 0; + } + } //inode with the same ctime + the same size and links and <= block_count, skipped if (ext2fs_le32_to_cpu(inode_pointer->i_ctime) == ctime){ if (item) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/src/magic_block_scan.c new/ext4magic-0.3.1/src/magic_block_scan.c --- old/ext4magic-0.3.0/src/magic_block_scan.c 2012-02-19 13:59:06.000000000 +0100 +++ new/ext4magic-0.3.1/src/magic_block_scan.c 2012-04-04 22:17:25.000000000 +0200 @@ -509,6 +509,15 @@ } +static int is_ecryptfs(unsigned char* buf){ + int ret = 0; + if ((!buf[0]) && (!buf[20]) && (!buf[21]) && (buf[22]) && (!buf[23]) && (!buf[24]) && + ((buf[8] ^ buf[12]) == 0x3c) && ((buf[9] ^ buf[13]) == 0x81) && ((buf[10] ^ buf[14]) == 0xb7) && ((buf[11] ^ buf[15]) == 0xf5)) + ret =1; + return ret; +} + + //magic scanner //FIXME static int magic_check_block(unsigned char* buf,magic_t cookie , magic_t cookie_f, char *magic_buf, __u32 size, blk_t blk, int deep){ @@ -647,7 +656,10 @@ } else{ if ((strstr(magic_buf,"application/octet-stream")) && (!(strncmp(text,"data",4)))){ - retval |= M_DATA; + if (is_ecryptfs (buf)) + strncpy(text,"ecryptfs ",9); + else + retval |= M_DATA; } } @@ -693,7 +705,7 @@ } if (strstr(magic_buf,"application/octet-stream")){ - char searchstr[] = "7-zip cpio CD-ROM MPEG 9660 Targa Kernel boot SQLite OpenOffice.org VMWare3 VMware4 JPEG ART PCX IFF DIF RIFF ATSC ScreamTracker matroska LZMA Audio=Visual Sample=Vision ISO=Media ext2 ext3 ext4 LUKS python ESRI=Shape "; + char searchstr[] = "7-zip cpio CD-ROM MPEG 9660 Targa Kernel boot SQLite OpenOffice.org VMWare3 VMware4 JPEG ART PCX IFF DIF RIFF ATSC ScreamTracker matroska LZMA Audio=Visual Sample=Vision ISO=Media ext2 ext3 ext4 LUKS python ESRI=Shape ecryptfs "; p_search = searchstr; while (*p_search){ len=0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext4magic-0.3.0/src/util.c new/ext4magic-0.3.1/src/util.c --- old/ext4magic-0.3.0/src/util.c 2012-02-19 12:24:16.000000000 +0100 +++ new/ext4magic-0.3.1/src/util.c 2012-07-25 23:38:47.000000000 +0200 @@ -176,20 +176,20 @@ ext2fs_le32_to_cpu(inode->i_crtime) : 0 ; for (j=1;j <= cm ; j++){ - if ((d_time < hist[j].time) && (d_time > hist[j-1].time)){ + if ((d_time <= hist[j].time) && (d_time > hist[j-1].time)){ hist[j].d_count++; break; } if (cr_time){ - if ((cr_time < hist[j].time) && (cr_time > hist[j-1].time)){ + if ((cr_time <= hist[j].time) && (cr_time > hist[j-1].time)){ hist[j].cr_count++; crt_found = 1; cr_time = 0 ; } } - if ((c_time < hist[j].time) && (c_time > hist[j-1].time)){ + if ((c_time <= hist[j].time) && (c_time > hist[j-1].time)){ hist[j].c_count++; break; } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
