diff -Nru nwipe-0.21/configure.ac nwipe-0.24/configure.ac --- nwipe-0.21/configure.ac 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/configure.ac 2017-12-06 19:44:12.000000000 +0000 @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT(nwipe, 0.21, git@brumit.nl) -AM_INIT_AUTOMAKE(nwipe, 0.21) +AC_INIT(nwipe, 0.24, git@brumit.nl) +AM_INIT_AUTOMAKE(nwipe, 0.24) AC_OUTPUT(Makefile src/Makefile man/Makefile) AC_CONFIG_SRCDIR([src/nwipe.c]) AC_CONFIG_HEADERS([config.h]) diff -Nru nwipe-0.21/debian/changelog nwipe-0.24/debian/changelog --- nwipe-0.21/debian/changelog 2017-11-01 19:07:55.000000000 +0000 +++ nwipe-0.24/debian/changelog 2017-12-09 11:41:26.000000000 +0000 @@ -1,3 +1,9 @@ +nwipe (0.24-1) unstable; urgency=medium + + * New upstream release + + -- Martijn van Brummelen Sat, 09 Dec 2017 12:41:26 +0100 + nwipe (0.21-2) unstable; urgency=medium * Change dependency to libparted-dev Closes : #878628. diff -Nru nwipe-0.21/debian/control nwipe-0.24/debian/control --- nwipe-0.21/debian/control 2017-11-01 19:07:55.000000000 +0000 +++ nwipe-0.24/debian/control 2017-12-09 11:41:26.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Martijn van Brummelen Build-Depends: debhelper (>= 9), autotools-dev, libparted-dev, libncurses5-dev, dpkg-dev (>= 1.16.1~), dh-autoreconf, pkg-config -Standards-Version: 4.1.1 +Standards-Version: 4.1.2 Homepage: https://github.com/martijnvanbrummelen/nwipe Vcs-Git: git://git.debian.org/git/collab-maint/nwipe.git Vcs-browser: http://git.debian.org/?p=collab-maint/nwipe.git diff -Nru nwipe-0.21/.gitignore nwipe-0.24/.gitignore --- nwipe-0.21/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ nwipe-0.24/.gitignore 2017-12-06 19:44:12.000000000 +0000 @@ -0,0 +1,31 @@ +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +compile +config.h +config.h.in +config.log +config.status +configure +depcomp +install-sh +man/Makefile +man/Makefile.in +missing +src/.deps/ +src/Makefile +src/Makefile.in +src/nwipe +src/nwipe-device.o +src/nwipe-gui.o +src/nwipe-isaac_rand.o +src/nwipe-logging.o +src/nwipe-method.o +src/nwipe-mt19937ar-cok.o +src/nwipe-nwipe.o +src/nwipe-options.o +src/nwipe-pass.o +src/nwipe-prng.o +src/nwipe-version.o +stamp-h1 diff -Nru nwipe-0.21/man/nwipe.1 nwipe-0.24/man/nwipe.1 --- nwipe-0.21/man/nwipe.1 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/man/nwipe.1 2017-12-06 19:44:12.000000000 +0000 @@ -1,4 +1,4 @@ -.TH NWIPE "1" "October 2014" "nwipe version 0.17" "User Commands" +.TH NWIPE "1" "December 2017" "nwipe version 0.24" "User Commands" .SH NAME nwipe \- securely erase disks .SH SYNOPSIS @@ -78,11 +78,10 @@ \fB\-r\fR, \fB\-\-rounds\fR=\fINUM\fR Number of times to wipe the device using the selected method (default: 1) .SH BUGS -Please see the sourceforge site for the latest list -(http://nwipe.sourceforge.net) +Please see the github site for the latest list +(https://github.com/martijnvanbrummelen/nwipe/issues) .SH AUTHOR -Nwipe was released by Andy Beverley -as modified version of dwipe from DBAN by Darik Horn . +Nwipe is developed by Martijn van Brummelen .SH "SEE ALSO" .BR shred (1), .BR dwipe (1), diff -Nru nwipe-0.21/README nwipe-0.24/README --- nwipe-0.21/README 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/README 2017-12-06 19:44:12.000000000 +0000 @@ -18,6 +18,18 @@ RELEASE NOTES ============= +v0.24 +- use include values for version 0.17 +- display throughput value more friendly(Thanks Kelderek) + +v0.23 +- make serial visible again on 32Bit machines + +v0.22 +- Update manpage +- use long long for device size +- Use ped_unit_format_byte function to display(friendly) size of device + v0.21 - Fix ETA not updating properly and bad total throughput display. Thanks (Niels Bassler). diff -Nru nwipe-0.21/src/context.h nwipe-0.24/src/context.h --- nwipe-0.21/src/context.h 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/context.h 2017-12-06 19:44:12.000000000 +0000 @@ -72,48 +72,49 @@ typedef struct nwipe_context_t_ { - int block_size; /* The soft block size reported the device. */ - int device_bus; /* The device bus number. */ - int device_fd; /* The file descriptor of the device file being wiped. */ - int device_host; /* The host number. */ - struct hd_driveid device_id; /* The WIN_IDENTIFY data for IDE drives. */ - int device_lun; /* The device logical unit number. */ - int device_major; /* The major device number. */ - int device_minor; /* The minor device number. */ - int device_part; /* The device partition or slice number. */ - char* device_name; /* The device file name. */ - off64_t device_size; /* The device size in bytes. */ - struct stat device_stat; /* The device file state from fstat(). */ - nwipe_device_t device_type; /* Indicates an IDE, SCSI, or Compaq SMART device. */ - int device_target; /* The device target. */ - u64 eta; /* The estimated number of seconds until method completion. */ - int entropy_fd; /* The entropy source. Usually /dev/urandom. */ - char* label; /* The string that we will show the user. */ - int pass_count; /* The number of passes performed by the working wipe method. */ - u64 pass_done; /* The number of bytes that have already been i/o'd in this pass. */ - u64 pass_errors; /* The number of errors across all passes. */ - u64 pass_size; /* The total number of i/o bytes across all passes. */ - nwipe_pass_t pass_type; /* The type of the current working pass. */ - int pass_working; /* The current working pass. */ - nwipe_prng_t* prng; /* The PRNG implementation. */ - nwipe_entropy_t prng_seed; /* The random data that is used to seed the PRNG. */ - void* prng_state; /* The private internal state of the PRNG. */ - int result; /* The process return value. */ - int round_count; /* The number of rounds performed by the working wipe method. */ - u64 round_done; /* The number of bytes that have already been i/o'd. */ - u64 round_errors; /* The number of errors across all rounds. */ - u64 round_size; /* The total number of i/o bytes across all rounds. */ - double round_percent; /* The percentage complete across all rounds. */ - int round_working; /* The current working round. */ - int sector_size; /* The hard sector size reported by the device. */ - nwipe_select_t select; /* Indicates whether this device should be wiped. */ - int signal; /* Set when the child is killed by a signal. */ - nwipe_speedring_t speedring; /* Ring buffer for computing the rolling throughput average. */ - short sync_status; /* A flag to indicate when the method is syncing. */ - pthread_t thread; /* The ID of the thread. */ - u64 throughput; /* Average throughput in bytes per second. */ - u64 verify_errors; /* The number of verification errors across all passes. */ - struct hd_driveid identity; /* The serial number of the drive (where applicable) */ + int block_size; /* The soft block size reported the device. */ + int device_bus; /* The device bus number. */ + int device_fd; /* The file descriptor of the device file being wiped. */ + int device_host; /* The host number. */ + struct hd_driveid device_id; /* The WIN_IDENTIFY data for IDE drives. */ + int device_lun; /* The device logical unit number. */ + int device_major; /* The major device number. */ + int device_minor; /* The minor device number. */ + int device_part; /* The device partition or slice number. */ + char* device_name; /* The device file name. */ + long long device_size; /* The device size in bytes. */ + char* device_size_text; /* The device size in a more (human)readable format. */ + struct stat device_stat; /* The device file state from fstat(). */ + nwipe_device_t device_type; /* Indicates an IDE, SCSI, or Compaq SMART device. */ + int device_target; /* The device target. */ + u64 eta; /* The estimated number of seconds until method completion. */ + int entropy_fd; /* The entropy source. Usually /dev/urandom. */ + char* label; /* The string that we will show the user. */ + int pass_count; /* The number of passes performed by the working wipe method. */ + u64 pass_done; /* The number of bytes that have already been i/o'd in this pass. */ + u64 pass_errors; /* The number of errors across all passes. */ + u64 pass_size; /* The total number of i/o bytes across all passes. */ + nwipe_pass_t pass_type; /* The type of the current working pass. */ + int pass_working; /* The current working pass. */ + nwipe_prng_t* prng; /* The PRNG implementation. */ + nwipe_entropy_t prng_seed; /* The random data that is used to seed the PRNG. */ + void* prng_state; /* The private internal state of the PRNG. */ + int result; /* The process return value. */ + int round_count; /* The number of rounds performed by the working wipe method. */ + u64 round_done; /* The number of bytes that have already been i/o'd. */ + u64 round_errors; /* The number of errors across all rounds. */ + u64 round_size; /* The total number of i/o bytes across all rounds. */ + double round_percent; /* The percentage complete across all rounds. */ + int round_working; /* The current working round. */ + int sector_size; /* The hard sector size reported by the device. */ + nwipe_select_t select; /* Indicates whether this device should be wiped. */ + int signal; /* Set when the child is killed by a signal. */ + nwipe_speedring_t speedring; /* Ring buffer for computing the rolling throughput average. */ + short sync_status; /* A flag to indicate when the method is syncing. */ + pthread_t thread; /* The ID of the thread. */ + u64 throughput; /* Average throughput in bytes per second. */ + u64 verify_errors; /* The number of verification errors across all passes. */ + struct hd_driveid identity; /* The serial number of the drive (where applicable) */ } nwipe_context_t; diff -Nru nwipe-0.21/src/device.c nwipe-0.24/src/device.c --- nwipe-0.21/src/device.c 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/device.c 2017-12-06 19:44:12.000000000 +0000 @@ -30,7 +30,7 @@ #include "logging.h" #include -#include +#include int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount ); @@ -124,6 +124,7 @@ next_device->label = dev->model; next_device->device_name = dev->path; next_device->device_size = dev->length * dev->sector_size; + next_device->device_size_text = ped_unit_format_byte(dev, dev->length * dev->sector_size); /* Attempt to get serial number of device. */ ioctl(next_device->device_fd, HDIO_GET_IDENTITY, &next_device->identity); diff -Nru nwipe-0.21/src/gui.c nwipe-0.24/src/gui.c --- nwipe-0.21/src/gui.c 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/gui.c 2017-12-06 19:44:12.000000000 +0000 @@ -29,7 +29,6 @@ * and things like ncurses libmenu are not worth the storage overhead. * */ - /* Why is this needed? Segfaults without it */ #include @@ -41,6 +40,8 @@ #include "gui.h" #include "pass.h" #include "logging.h" +#include "version.h" + #define NWIPE_GUI_PANE 8 @@ -229,7 +230,7 @@ wclear( header_window ); /* Print the product banner. */ - nwipe_gui_title( header_window, nwipe_options.banner ); + nwipe_gui_title( header_window, banner ); /* Create the footer window. */ footer_window = newwin( NWIPE_GUI_FOOTER_H, NWIPE_GUI_FOOTER_W, NWIPE_GUI_FOOTER_Y, NWIPE_GUI_FOOTER_X ); @@ -446,40 +447,40 @@ { case NWIPE_SELECT_TRUE: - wprintw( main_window, " [wipe] %i. %s - %s %s (%lld bytes)", (i + offset + 1), + wprintw( main_window, " [wipe] %i. %s - %s %s (%s)", (i + offset + 1), c[i+offset]->device_name, c[i+offset]->label, c[i+offset]->identity.serial_no, - c[i+offset]->device_size ); + c[i+offset]->device_size_text ); break; case NWIPE_SELECT_FALSE: /* Print an element that is not selected. */ - wprintw( main_window, " [ ] %i. %s - %s %s (%lld bytes)", (i + offset +1), + wprintw( main_window, " [ ] %i. %s - %s %s (%s)", (i + offset +1), c[i+offset]->device_name, c[i+offset]->label, c[i+offset]->identity.serial_no, - c[i+offset]->device_size ); + c[i+offset]->device_size_text ); break; case NWIPE_SELECT_TRUE_PARENT: /* This element will be wiped when its parent is wiped. */ - wprintw( main_window, " [****] %i. %s - %s %s (%lld bytes)", (i + offset +1), + wprintw( main_window, " [****] %i. %s - %s %s (%s)", (i + offset +1), c[i+offset]->device_name, c[i+offset]->label, c[i+offset]->identity.serial_no, - c[i+offset]->device_size ); + c[i+offset]->device_size_text ); break; case NWIPE_SELECT_FALSE_CHILD: /* We can't wipe this element because it has a child that is being wiped. */ - wprintw( main_window, " [----] %i. %s - %s %s (%lld bytes)", (i + offset +1), + wprintw( main_window, " [----] %i. %s - %s %s (%s)", (i + offset +1), c[i+offset]->device_name, c[i+offset]->label, c[i+offset]->identity.serial_no, - c[i+offset]->device_size ); + c[i+offset]->device_size_text ); break; case NWIPE_SELECT_DISABLED: @@ -1867,13 +1868,13 @@ if( c[i]->sync_status ) { wprintw( main_window, "[syncing] " ); } - if( c[i]->throughput >= INT64_C( 1000000000000000 ) ) + if( c[i]->throughput >= INT64_C( 1000000000000 ) ) { wprintw( main_window, "[%llu TB/s] ", c[i]->throughput / INT64_C( 1000000000000 ) ); } - else if( c[i]->throughput >= INT64_C( 1000000000000 ) ) - { wprintw( main_window, "[%llu GB/s] ", c[i]->throughput / INT64_C( 1000000000 ) ); } else if( c[i]->throughput >= INT64_C( 1000000000 ) ) - { wprintw( main_window, "[%llu MB/s] ", c[i]->throughput / INT64_C( 1000000 ) ); } + { wprintw( main_window, "[%llu GB/s] ", c[i]->throughput / INT64_C( 1000000000 ) ); } else if( c[i]->throughput >= INT64_C( 1000000 ) ) + { wprintw( main_window, "[%llu MB/s] ", c[i]->throughput / INT64_C( 1000000 ) ); } + else if( c[i]->throughput >= INT64_C( 1000 ) ) { wprintw( main_window, "[%llu KB/s] ", c[i]->throughput / INT64_C( 1000 ) ); } else { wprintw( main_window, "[%llu B/s] ", c[i]->throughput / INT64_C( 1 ) ); } @@ -1908,13 +1909,13 @@ u64 nwipe_throughput = nwipe_misc_thread_data->throughput; - if( nwipe_throughput >= INT64_C( 1000000000000000 ) ) + if( nwipe_throughput >= INT64_C( 1000000000000 ) ) { nwipe_throughput /= INT64_C( 1000000000000 ); nwipe_format = nwipe_tera; } - else if( nwipe_throughput >= INT64_C( 1000000000000 ) ) - { nwipe_throughput /= INT64_C( 1000000000 ); nwipe_format = nwipe_giga; } else if( nwipe_throughput >= INT64_C( 1000000000 ) ) - { nwipe_throughput /= INT64_C( 1000000 ); nwipe_format = nwipe_mega; } + { nwipe_throughput /= INT64_C( 1000000000 ); nwipe_format = nwipe_giga; } else if( nwipe_throughput >= INT64_C( 1000000 ) ) + { nwipe_throughput /= INT64_C( 1000000 ); nwipe_format = nwipe_mega; } + else if( nwipe_throughput >= INT64_C( 1000 ) ) { nwipe_throughput /= INT64_C( 1000 ); nwipe_format = nwipe_kilo; } else { nwipe_throughput /= INT64_C( 1 ); nwipe_format = nwipe_unit; } diff -Nru nwipe-0.21/src/isaac_rand.c nwipe-0.24/src/isaac_rand.c --- nwipe-0.21/src/isaac_rand.c 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/isaac_rand.c 2017-12-06 19:44:12.000000000 +0000 @@ -29,8 +29,10 @@ randctx *ctx; { register ub4 a,b,x,y,*m,*mm,*m2,*r,*mend; - mm=ctx->randmem; r=ctx->randrsl; - a = ctx->randa; b = ctx->randb + (++ctx->randc); + mm=ctx->randmem; + r=ctx->randrsl; + a = ctx->randa; + b = ctx->randb + (++ctx->randc); for (m = mm, mend = m2 = m+(RANDSIZ/2); mdevice_size == (off64_t)-1 ) + if( c2[i]->device_size == (long long)-1 ) { /* We cannot determine the size of this device. */ nwipe_perror( errno, __FUNCTION__, "lseek" ); diff -Nru nwipe-0.21/src/options.c nwipe-0.24/src/options.c --- nwipe-0.21/src/options.c 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/options.c 2017-12-06 19:44:12.000000000 +0000 @@ -42,9 +42,6 @@ extern nwipe_prng_t nwipe_twister; extern nwipe_prng_t nwipe_isaac; - /* The maximum banner size, including the null. */ - const int nwipe_banner_size = 81; - /* The getopt() result holder. */ int nwipe_opt; @@ -100,15 +97,6 @@ { 0, 0, 0, 0 } }; - /* Note that COLS isn't available until ncurses is initialized. */ - nwipe_options.banner = malloc( nwipe_banner_size ); - - /* Set the default product banner. */ - /* TODO: Add version constant. */ - strncpy ( nwipe_options.banner, program_name, nwipe_banner_size); - strncat ( nwipe_options.banner, " ", nwipe_banner_size - strlen (nwipe_options.banner) - 1); - strncat ( nwipe_options.banner, version_string, nwipe_banner_size - strlen (nwipe_options.banner) - 1); - strncat ( nwipe_options.banner, " (based on DBAN's dwipe - Darik's Wipe)", nwipe_banner_size - strlen (nwipe_options.banner) - 1); /* Set default options. */ nwipe_options.autonuke = 0; @@ -286,7 +274,7 @@ || nwipe_options.rounds < 1 ) { - fprintf( stderr, "Error: The rounds argument must be a postive integer.\n" ); + fprintf( stderr, "Error: The rounds argument must be a positive integer.\n" ); exit( EINVAL ); } @@ -352,7 +340,7 @@ nwipe_log( NWIPE_LOG_NOTICE, " do not show GUI interface" ); } - nwipe_log( NWIPE_LOG_NOTICE, " banner = %s", nwipe_options.banner ); + nwipe_log( NWIPE_LOG_NOTICE, " banner = %s", banner ); nwipe_log( NWIPE_LOG_NOTICE, " method = %s", nwipe_method_label( nwipe_options.method ) ); nwipe_log( NWIPE_LOG_NOTICE, " rounds = %i", nwipe_options.rounds ); nwipe_log( NWIPE_LOG_NOTICE, " sync = %i", nwipe_options.sync ); diff -Nru nwipe-0.21/src/options.h nwipe-0.24/src/options.h --- nwipe-0.21/src/options.h 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/options.h 2017-12-06 19:44:12.000000000 +0000 @@ -48,9 +48,9 @@ { int autonuke; /* Do not prompt the user for confirmation when set. */ int noblank; /* Do not perform a final blanking pass. */ - int nowait; /* Do not wait for a final key before exiting. */ - int nosignals; /* Do not allow signals to interrupt a wipe. */ - int nogui ; /* Do not show the GUI. */ + int nowait; /* Do not wait for a final key before exiting. */ + int nosignals; /* Do not allow signals to interrupt a wipe. */ + int nogui ; /* Do not show the GUI. */ char* banner; /* The product banner shown on the top line of the screen. */ // nwipe_method_t method; /* A function pointer to the wipe method that will be used. */ void* method; /* A function pointer to the wipe method that will be used. */ diff -Nru nwipe-0.21/src/version.c nwipe-0.24/src/version.c --- nwipe-0.21/src/version.c 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/version.c 2017-12-06 19:44:12.000000000 +0000 @@ -4,13 +4,14 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char *version_string = "0.21"; +const char *version_string = "0.24"; const char *program_name = "nwipe"; const char *author_name = "Martijn van Brummelen"; const char *email_address = "git@brumit.nl"; -const char *years = "2016"; +const char *years = "2017"; const char *copyright = "Copyright Darik Horn \n\ Modifications to original dwipe Copyright Andy Beverley \n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\ FOR A PARTICULAR PURPOSE.\n"; +const char *banner = "nwipe 0.24 (based on DBAN's dwipe - Darik's Wipe)"; diff -Nru nwipe-0.21/src/version.h nwipe-0.24/src/version.h --- nwipe-0.21/src/version.h 2016-08-24 13:21:30.000000000 +0000 +++ nwipe-0.24/src/version.h 2017-12-06 19:44:12.000000000 +0000 @@ -6,5 +6,6 @@ extern char *author_name; extern char *email_address; extern char *copyright; +extern char *banner; #endif/*__VERSION_H*/