diff options
author | 2015-04-24 15:24:10 +0000 | |
---|---|---|
committer | 2015-04-24 15:24:10 +0000 | |
commit | 768b5539a75c192b740582d960343200e209d3d1 (patch) | |
tree | 48b212704af504b987047d0d5e0958ace11e3285 /app-admin/testdisk | |
parent | Mask net-libs/libcapsinetwork (diff) | |
download | gentoo-2-768b5539a75c192b740582d960343200e209d3d1.tar.gz gentoo-2-768b5539a75c192b740582d960343200e209d3d1.tar.bz2 gentoo-2-768b5539a75c192b740582d960343200e209d3d1.zip |
app-admin/testdisk: Updated testdisk-6.14.
Added patch suggested by jospezial (Comment 5 of Bug 537932).
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key AC91CA52)
Diffstat (limited to 'app-admin/testdisk')
-rw-r--r-- | app-admin/testdisk/ChangeLog | 10 | ||||
-rw-r--r-- | app-admin/testdisk/files/fix_rare_crash-6.14.patch | 227 | ||||
-rw-r--r-- | app-admin/testdisk/testdisk-6.14-r1.ebuild | 84 | ||||
-rw-r--r-- | app-admin/testdisk/testdisk-7.0-r2.ebuild | 5 |
4 files changed, 322 insertions, 4 deletions
diff --git a/app-admin/testdisk/ChangeLog b/app-admin/testdisk/ChangeLog index 59bac5d41727..f01af220f72d 100644 --- a/app-admin/testdisk/ChangeLog +++ b/app-admin/testdisk/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-admin/testdisk # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/ChangeLog,v 1.60 2015/04/21 16:27:26 nicolasbock Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/ChangeLog,v 1.61 2015/04/24 15:24:10 nicolasbock Exp $ + +*testdisk-6.14-r1 (24 Apr 2015) + + 24 Apr 2015; Nicolas Bock <nicolasbock@gentoo.org> + +files/fix_rare_crash-6.14.patch, +testdisk-6.14-r1.ebuild, + testdisk-7.0-r2.ebuild: + app-admin/testdisk: Updated testdisk-6.14. Added patch suggested by jospezial + (Comment 5 of Bug 537932). 21 Apr 2015; Nicolas Bock <nicolasbock@gentoo.org> metadata.xml, testdisk-7.0-r2.ebuild: diff --git a/app-admin/testdisk/files/fix_rare_crash-6.14.patch b/app-admin/testdisk/files/fix_rare_crash-6.14.patch new file mode 100644 index 000000000000..913be7e32ebd --- /dev/null +++ b/app-admin/testdisk/files/fix_rare_crash-6.14.patch @@ -0,0 +1,227 @@ +From a2676d349a975a142f1119c0aecb435e1b0db8b8 Mon Sep 17 00:00:00 2001 +From: Christophe Grenier <grenier@cgsecurity.org> +Date: Sat, 14 Jun 2014 12:08:59 +0200 +Subject: TestDisk: fix rare crash when listing NTFS directories + + +diff --git a/src/ntfs_dir.c b/src/ntfs_dir.c +index d416cea..b51c63d 100644 +--- a/src/ntfs_dir.c ++++ b/src/ntfs_dir.c +@@ -167,7 +167,15 @@ static int ntfs_td_list_entry( struct ntfs_dir_struct *ls, const ntfschar *name + const MFT_REF mref, const unsigned dt_type) + { + int result = 0; +- char *filename = (char *)calloc (1, MAX_PATH); ++ char *filename; ++ ntfs_inode *ni; ++ ntfs_attr_search_ctx *ctx_si = NULL; ++ file_info_t *new_file=NULL; ++ /* Keep FILE_NAME_WIN32 and FILE_NAME_POSIX */ ++ if ((name_type & FILE_NAME_WIN32_AND_DOS) == FILE_NAME_DOS) ++ return 0; ++ ++ filename = (char *)calloc (1, MAX_PATH); + if (!filename) + { + log_critical("ntfs_td_list_entry calloc failed\n"); +@@ -178,118 +186,111 @@ static int ntfs_td_list_entry( struct ntfs_dir_struct *ls, const ntfschar *name + if (ntfs_ucstoutf8(ls->cd, name, name_len, &filename, MAX_PATH) < 0 && + ntfs_ucstombs (name, name_len, &filename, MAX_PATH) < 0) { + log_error("Cannot represent filename in current locale.\n"); +- goto free; ++ goto freefn; + } + #else + if (ntfs_ucstombs (name, name_len, &filename, MAX_PATH) < 0) { + log_error("Cannot represent filename in current locale.\n"); +- goto free; ++ goto freefn; + } + #endif + + result = 0; /* These are successful */ + if (MREF(mref) < FILE_first_user && filename[0] == '$') /* Hide system file */ +- goto free; +- /* Keep FILE_NAME_WIN32 and FILE_NAME_POSIX */ +- if ((name_type & FILE_NAME_WIN32_AND_DOS) == FILE_NAME_DOS) +- goto free; +- { +- ntfs_inode *ni; +- ntfs_attr_search_ctx *ctx_si = NULL; +- file_info_t *new_file=NULL; ++ goto freefn; ++ result = -1; /* Everything else is bad */ + +- result = -1; /* Everything else is bad */ ++ ni = ntfs_inode_open(ls->vol, mref); ++ if (!ni) ++ goto freefn; ++ new_file=(file_info_t*)MALLOC(sizeof(*new_file)); ++ new_file->status=0; ++ new_file->st_ino=MREF(mref); ++ new_file->st_uid=0; ++ new_file->st_gid=0; + +- ni = ntfs_inode_open(ls->vol, mref); +- if (!ni) +- goto release; +- new_file=(file_info_t*)MALLOC(sizeof(*new_file)); +- new_file->status=0; +- td_list_add_tail(&new_file->list, &ls->dir_list->list); +- new_file->st_ino=MREF(mref); +- new_file->st_uid=0; +- new_file->st_gid=0; +- +- ctx_si = ntfs_attr_get_search_ctx(ni, ni->mrec); +- if (ctx_si) ++ ctx_si = ntfs_attr_get_search_ctx(ni, ni->mrec); ++ if (ctx_si) ++ { ++ if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED, 0, CASE_SENSITIVE, 0, NULL, 0, ctx_si)==0) + { +- if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED, 0, CASE_SENSITIVE, 0, NULL, 0, ctx_si)==0) ++ const ATTR_RECORD *attr = ctx_si->attr; ++ const STANDARD_INFORMATION *si = (const STANDARD_INFORMATION*)((const char*)attr + ++ le16_to_cpu(attr->value_offset)); ++ if(si) + { +- const ATTR_RECORD *attr = ctx_si->attr; +- const STANDARD_INFORMATION *si = (const STANDARD_INFORMATION*)((const char*)attr + +- le16_to_cpu(attr->value_offset)); +- if(si) +- { +- new_file->td_atime=td_ntfs2utc(sle64_to_cpu(si->last_access_time)); +- new_file->td_mtime=td_ntfs2utc(sle64_to_cpu(si->last_data_change_time)); +- new_file->td_ctime=td_ntfs2utc(sle64_to_cpu(si->creation_time)); +- } ++ new_file->td_atime=td_ntfs2utc(sle64_to_cpu(si->last_access_time)); ++ new_file->td_mtime=td_ntfs2utc(sle64_to_cpu(si->last_data_change_time)); ++ new_file->td_ctime=td_ntfs2utc(sle64_to_cpu(si->creation_time)); + } +- ntfs_attr_put_search_ctx(ctx_si); + } ++ ntfs_attr_put_search_ctx(ctx_si); ++ } ++ { ++ ATTR_RECORD *rec; ++ int first=1; ++ ntfs_attr_search_ctx *ctx = NULL; ++ if (dt_type == NTFS_DT_DIR) + { +- ATTR_RECORD *rec; +- int first=1; +- ntfs_attr_search_ctx *ctx = NULL; +- if (dt_type == NTFS_DT_DIR) ++ new_file->name=strdup(filename); ++ new_file->st_mode = LINUX_S_IFDIR| LINUX_S_IRUGO | LINUX_S_IXUGO; ++ new_file->st_size=0; ++ td_list_add_tail(&new_file->list, &ls->dir_list->list); ++ first=0; ++ } ++ ctx = ntfs_attr_get_search_ctx(ni, ni->mrec); ++ /* A file has always an unnamed date stream and ++ * may have named alternate data streams (ADS) */ ++ while((rec = find_attribute(AT_DATA, ctx))) ++ { ++ const s64 filesize = ntfs_get_attribute_value_length(ctx->attr); ++ if(rec->name_length && ++ (ls->dir_data->param & FLAG_LIST_ADS)!=FLAG_LIST_ADS) ++ continue; ++ if(first==0) + { +- new_file->name=strdup(filename); +- new_file->st_mode = LINUX_S_IFDIR| LINUX_S_IRUGO | LINUX_S_IXUGO; +- new_file->st_size=0; +- td_list_add_tail(&new_file->list, &ls->dir_list->list); +- first=0; ++ const file_info_t *old_file=new_file; ++ new_file=(file_info_t *)MALLOC(sizeof(*new_file)); ++ memcpy(new_file, old_file, sizeof(*new_file)); + } +- ctx = ntfs_attr_get_search_ctx(ni, ni->mrec); +- /* A file has always an unnamed date stream and +- * may have named alternate data streams (ADS) */ +- while((rec = find_attribute(AT_DATA, ctx))) ++ new_file->st_mode = LINUX_S_IFREG | LINUX_S_IRUGO; ++ new_file->st_size=filesize; ++ if (rec->name_length) + { +- const s64 filesize = ntfs_get_attribute_value_length(ctx->attr); +- if(rec->name_length && +- (ls->dir_data->param & FLAG_LIST_ADS)!=FLAG_LIST_ADS) +- continue; +- if(first==0) +- { +- const file_info_t *old_file=new_file; +- new_file=(file_info_t *)MALLOC(sizeof(*new_file)); +- memcpy(new_file, old_file, sizeof(*new_file)); +- } +- new_file->st_mode = LINUX_S_IFREG | LINUX_S_IRUGO; +- new_file->st_size=filesize; +- if (rec->name_length) ++ char *stream_name=NULL; ++ new_file->status=FILE_STATUS_ADS; ++ new_file->name = (char *)MALLOC(MAX_PATH); ++ if (ntfs_ucstombs((ntfschar *) ((char *) rec + le16_to_cpu(rec->name_offset)), ++ rec->name_length, &stream_name, 0) < 0) + { +- char *stream_name=NULL; +- new_file->status=FILE_STATUS_ADS; +- new_file->name = (char *)MALLOC(MAX_PATH); +- if (ntfs_ucstombs((ntfschar *) ((char *) rec + le16_to_cpu(rec->name_offset)), +- rec->name_length, &stream_name, 0) < 0) +- { +- log_error("ERROR: Cannot translate name into current locale.\n"); +- snprintf(new_file->name, MAX_PATH, "%s:???", filename); +- } +- else +- { +- snprintf(new_file->name, MAX_PATH, "%s:%s", filename, stream_name); +- } +- free(stream_name); ++ log_error("ERROR: Cannot translate name into current locale.\n"); ++ snprintf(new_file->name, MAX_PATH, "%s:???", filename); + } + else + { +- new_file->name=strdup(filename); ++ snprintf(new_file->name, MAX_PATH, "%s:%s", filename, stream_name); + } +- td_list_add_tail(&new_file->list, &ls->dir_list->list); +- first=0; ++ free(stream_name); + } +- ntfs_attr_put_search_ctx(ctx); ++ else ++ { ++ new_file->name=strdup(filename); ++ } ++ td_list_add_tail(&new_file->list, &ls->dir_list->list); ++ first=0; ++ } ++ ntfs_attr_put_search_ctx(ctx); ++ if(first) ++ { ++ free(new_file); + } +- +- result = 0; +-release: +- /* close the inode. */ +- if (ni) +- ntfs_inode_close(ni); + } +-free: ++ ++ result = 0; ++ /* close the inode. */ ++ if (ni) ++ ntfs_inode_close(ni); ++freefn: + free (filename); + return result; + } +-- +cgit v0.10.2 + diff --git a/app-admin/testdisk/testdisk-6.14-r1.ebuild b/app-admin/testdisk/testdisk-6.14-r1.ebuild new file mode 100644 index 000000000000..41558fb1b655 --- /dev/null +++ b/app-admin/testdisk/testdisk-6.14-r1.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/testdisk-6.14-r1.ebuild,v 1.1 2015/04/24 15:24:10 nicolasbock Exp $ + +EAPI=5 + +inherit autotools-utils eutils flag-o-matic + +DESCRIPTION="Checks and undeletes partitions + PhotoRec, signature based recovery tool" +HOMEPAGE="http://www.cgsecurity.org/wiki/TestDisk" +SRC_URI="http://www.cgsecurity.org/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~x86" +IUSE="ewf jpeg ntfs reiserfs static qt4" + +REQUIRED_USE="static? ( !qt4 )" + +# WARNING: reiserfs support does NOT work with reiserfsprogs +# you MUST use progsreiserfs-0.3.1_rc8 (the last version ever released). +DEPEND=" + static? ( + sys-apps/util-linux[static-libs] + >=sys-libs/ncurses-5.2[static-libs] + jpeg? ( virtual/jpeg:*[static-libs] ) + ntfs? ( sys-fs/ntfs3g[static-libs] ) + reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8[static-libs] ) + >=sys-fs/e2fsprogs-1.35[static-libs] + sys-libs/zlib[static-libs] + !arm? ( ewf? ( app-forensics/libewf:*[static-libs] ) ) + ) + !static? ( + sys-apps/util-linux + >=sys-libs/ncurses-5.2 + jpeg? ( virtual/jpeg:* ) + ntfs? ( sys-fs/ntfs3g ) + reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8 ) + >=sys-fs/e2fsprogs-1.35 + sys-libs/zlib + !arm? ( ewf? ( app-forensics/libewf:* ) ) + qt4? ( >=dev-qt/qtgui-4.0.1:* ) + )" +RDEPEND="!static? ( ${DEPEND} )" + +PATCHES=( + "${FILESDIR}/fix_rare_crash-6.14.patch" + ) +DOCS=( ) +AUTOTOOLS_AUTORECONF=1 +BUILD_DIR="${S}" + +src_configure() { + local myconf + + # this is static method is the same used by upstream for their 'static' make + # target, but better, as it doesn't break. + use static && append-ldflags -static + + # --with-foo are broken, any use of --with/--without disable the + # functionality. + # The following variation must be used. + use reiserfs || myconf+=" --without-reiserfs" + use ntfs || myconf+=" --without-ntfs --without-ntfs3g" + use jpeg || myconf+=" --without-jpeg" + use ewf || myconf+=" --without-ewf" + myconf+=$(usex qt4 " --enable-qt" " --disable-qt") + + econf \ + --docdir "${ROOT}/usr/share/doc/${P}" \ + --enable-sudo \ + ${myconf} + + # perform safety checks for NTFS, REISERFS and JPEG + if use ntfs && ! egrep -q '^#define HAVE_LIBNTFS(3G)? 1$' "${S}"/config.h ; then + die "Failed to find either NTFS or NTFS-3G library." + fi + if use reiserfs && egrep -q 'undef HAVE_LIBREISERFS\>' "${S}"/config.h ; then + die "Failed to find reiserfs library." + fi + if use jpeg && egrep -q 'undef HAVE_LIBJPEG\>' "${S}"/config.h ; then + die "Failed to find jpeg library." + fi +} diff --git a/app-admin/testdisk/testdisk-7.0-r2.ebuild b/app-admin/testdisk/testdisk-7.0-r2.ebuild index 75180d26eb20..e8babc37450e 100644 --- a/app-admin/testdisk/testdisk-7.0-r2.ebuild +++ b/app-admin/testdisk/testdisk-7.0-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/testdisk-7.0-r2.ebuild,v 1.2 2015/04/21 16:27:26 nicolasbock Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/testdisk-7.0-r2.ebuild,v 1.3 2015/04/24 15:24:10 nicolasbock Exp $ EAPI=5 @@ -43,7 +43,6 @@ DEPEND=" )" RDEPEND="!static? ( ${DEPEND} )" -PATCHES=( "${FILESDIR}/install-gentoo.patch" ) DOCS=( ) AUTOTOOLS_AUTORECONF=1 BUILD_DIR="${S}" @@ -61,8 +60,8 @@ src_configure() { use reiserfs || myconf+=" --without-reiserfs" use ntfs || myconf+=" --without-ntfs --without-ntfs3g" use jpeg || myconf+=" --without-jpeg" - use qt4 || myconf+=" --disable-qt" use ewf || myconf+=" --without-ewf" + myconf+=$(usex qt4 " --enable-qt" " --disable-qt") econf \ --docdir "${ROOT}/usr/share/doc/${P}" \ |