Index: head/sysutils/dc3dd/Makefile =================================================================== --- head/sysutils/dc3dd/Makefile (revision 473204) +++ head/sysutils/dc3dd/Makefile (revision 473205) @@ -1,35 +1,37 @@ # Created by: MANTANI Nobutaka # $FreeBSD$ PORTNAME= dc3dd -PORTVERSION= 7.2.641 -PORTREVISION= 1 +PORTVERSION= 7.2.646 CATEGORIES= sysutils -MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/7.2 +MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}/${PORTNAME}%20${PORTVERSION} MAINTAINER= nobutaka@FreeBSD.org COMMENT= dd program useful for computer forensics LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING BROKEN_armv6= fails to compile: bit-field 'verify_error_if_negative_size__' has negative width BROKEN_armv7= fails to compile: bit-field 'verify_error_if_negative_size__' has negative width -USES= gettext iconv gmake tar:bzip2 +USES= gettext iconv gmake zip GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib OPTIONS_DEFINE= NLS .include .if ${PORT_OPTIONS:MNLS} PLIST_SUB+= NLS="" .else CONFIGURE_ARGS= --disable-nls PLIST_SUB+= NLS="@comment " .endif + +pre-configure: + ${CHMOD} +x ${WRKSRC}/configure .include Index: head/sysutils/dc3dd/distinfo =================================================================== --- head/sysutils/dc3dd/distinfo (revision 473204) +++ head/sysutils/dc3dd/distinfo (revision 473205) @@ -1,2 +1,3 @@ -SHA256 (dc3dd-7.2.641.tar.bz2) = b6141ab8a51f1edc0c594616da7407a335248244d500be883349cb355a2e426a -SIZE (dc3dd-7.2.641.tar.bz2) = 2917810 +TIMESTAMP = 1529848598 +SHA256 (dc3dd-7.2.646.zip) = c4e325e5cbdae49e3855b0849ea62fed17d553428724745cea53fe6d91fd2b7f +SIZE (dc3dd-7.2.646.zip) = 5066316 Index: head/sysutils/dc3dd/files/patch-lib_Makefile.in =================================================================== --- head/sysutils/dc3dd/files/patch-lib_Makefile.in (revision 473204) +++ head/sysutils/dc3dd/files/patch-lib_Makefile.in (revision 473205) @@ -1,21 +1,21 @@ ---- lib/Makefile.in.orig 2011-02-14 00:45:49.000000000 +0900 -+++ lib/Makefile.in 2011-02-14 00:50:19.000000000 +0900 -@@ -1629,18 +1629,6 @@ +--- lib/Makefile.in.orig 2012-11-06 03:52:20 UTC ++++ lib/Makefile.in +@@ -1629,18 +1629,6 @@ inttypes.h: inttypes.in.h all-local: charset.alias ref-add.sed ref-del.sed install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) - if test -f $(charset_alias); then \ - sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - else \ - if test $(GLIBC21) = no; then \ - sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - fi ; \ - fi uninstall-local: all-local if test -f $(charset_alias); then \ Index: head/sysutils/dc3dd/files/patch-src_dc3dd.c =================================================================== --- head/sysutils/dc3dd/files/patch-src_dc3dd.c (revision 473204) +++ head/sysutils/dc3dd/files/patch-src_dc3dd.c (revision 473205) @@ -1,68 +1,68 @@ ---- src/dc3dd.c.orig 2011-02-14 00:17:13.000000000 +0900 -+++ src/dc3dd.c 2011-02-14 00:22:11.000000000 +0900 +--- src/dc3dd.c.orig 2012-12-02 23:29:48 UTC ++++ src/dc3dd.c @@ -45,7 +45,7 @@ - #include - #include "hdparm/hpa_dco.h" + #include + #include "hdparm/hpa_dco.h" #endif -#elif defined (__APPLE__) +#elif defined (__APPLE__) || defined (__FreeBSD__) #include #include #elif defined (__CYGWIN__) -@@ -2325,6 +2325,56 @@ +@@ -2501,6 +2501,56 @@ get_file_stats(file_t* file) } } +#elif defined (__FreeBSD__) + +static void +get_file_stats(file_t* file) +{ + file->probed = false; + file->is_device = false; + file->is_block_device = false; + file->probed_sector_size = 0; + file->probed_size_in_sectors= 0; + file->probed_size_in_bytes = 0; + + struct stat file_info; + if (fstat(file->descriptor, &file_info) == 0) + { + if (file_info.st_mode & S_IFBLK) + { + // The file is a character device or a block device. It is necessary to + // use ioctl to query the OS to get the data to compute the size of the + // device. + file->is_device = true; + file->is_block_device = true; + + uint32_t sector_size = 0; + uintmax_t size_in_sectors = 0; + off_t size_in_bytes = 0; + if (ioctl(file->descriptor, DIOCGSECTORSIZE, §or_size) >= 0 && + ioctl(file->descriptor, DIOCGMEDIASIZE, &size_in_bytes) >= 0) + { + size_in_sectors = (uintmax_t)size_in_bytes / sector_size; + file->probed_size_in_sectors = (uintmax_t)size_in_sectors; + file->probed_sector_size = (uintmax_t)sector_size; + file->probed_size_in_bytes = file->probed_size_in_sectors * file->probed_sector_size; + file->probed = true; + } + } + else + { + // The file is a file (an image). + off_t start_of_file = lseek(file->descriptor, 0 , SEEK_CUR); + off_t end_of_file = lseek(file->descriptor, 0, SEEK_END); + if (lseek(file->descriptor, start_of_file, SEEK_SET) == 0) + { + file->probed_size_in_bytes = end_of_file - start_of_file; + file->probed = true; + } + } + } +} + #endif // ifdef __LINUX__ // End code copied (and modified) from md5deep helpers.c