From 7039f381af586b1e8923bd315c8acbe771e9e956 Mon Sep 17 00:00:00 2001 From: Niels Bassler Date: Sun, 21 Aug 2016 19:48:54 +0200 Subject: [PATCH 1/7] Fix total throughtput display, which showed cummulative throughput, and not current througput. Fix also ETA, which would never decrease. --- src/gui.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui.c b/src/gui.c index 1a847d4..ef7af8c 100644 --- a/src/gui.c +++ b/src/gui.c @@ -2036,6 +2036,9 @@ int compute_stats(void *ptr) int i; time_t nwipe_time_now = time( NULL ); + + nwipe_misc_thread_data->throughput = 0; + nwipe_misc_thread_data->maxeta = 0; /* Enumerate all contexts to compute statistics. */ for( i = 0 ; i < count ; i++ ) From 9c63eef56525ba9a49f5274538eec670a6f8c2b6 Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Wed, 24 Aug 2016 15:21:30 +0200 Subject: [PATCH 2/7] Version 0.21 --- README | 2 ++ configure.ac | 4 ++-- src/version.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README b/README index a49b105..097d6d5 100644 --- a/README +++ b/README @@ -18,6 +18,8 @@ Martijn van Brummelen RELEASE NOTES ============= +v0.21 +- Fix ETA not updating properly and bad total throughput display. Thanks (Niels Bassler). v0.20 - Fix build when panel header is not in /usr/include (Thanks Vincent Untz). diff --git a/configure.ac b/configure.ac index 7f9a60b..999f8ee 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT(nwipe, 0.18, git@brumit.nl) -AM_INIT_AUTOMAKE(nwipe, 0.18) +AC_INIT(nwipe, 0.21, git@brumit.nl) +AM_INIT_AUTOMAKE(nwipe, 0.21) AC_OUTPUT(Makefile src/Makefile man/Makefile) AC_CONFIG_SRCDIR([src/nwipe.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/src/version.c b/src/version.c index caa586d..a543478 100644 --- a/src/version.c +++ b/src/version.c @@ -4,7 +4,7 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char *version_string = "0.20"; +const char *version_string = "0.21"; const char *program_name = "nwipe"; const char *author_name = "Martijn van Brummelen"; const char *email_address = "git@brumit.nl"; From 0f26c8ea68adc7ba81f03bf309fdcaa045c94bbc Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Sun, 12 Feb 2017 19:05:36 +0100 Subject: [PATCH 3/7] use banner and update manpage --- README | 5 +++++ configure.ac | 2 +- man/nwipe.1 | 9 ++++----- src/gui.c | 2 +- src/options.c | 11 +---------- src/version.c | 3 ++- src/version.h | 1 + 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README b/README index 097d6d5..526a825 100644 --- a/README +++ b/README @@ -18,6 +18,11 @@ Martijn van Brummelen RELEASE NOTES ============= + +v0.22 +- Use const *banner instead of nwipe_options.banner(Cleanup of code) +- Update manpage + v0.21 - Fix ETA not updating properly and bad total throughput display. Thanks (Niels Bassler). diff --git a/configure.ac b/configure.ac index 999f8ee..5aea6bf 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT(nwipe, 0.21, git@brumit.nl) +AC_INIT(nwipe, 0.22, git@brumit.nl) AM_INIT_AUTOMAKE(nwipe, 0.21) AC_OUTPUT(Makefile src/Makefile man/Makefile) AC_CONFIG_SRCDIR([src/nwipe.c]) diff --git a/man/nwipe.1 b/man/nwipe.1 index 2da43f0..1e7304e 100644 --- a/man/nwipe.1 +++ b/man/nwipe.1 @@ -1,4 +1,4 @@ -.TH NWIPE "1" "October 2014" "nwipe version 0.17" "User Commands" +.TH NWIPE "1" "February 2017" "nwipe version 0.22" "User Commands" .SH NAME nwipe \- securely erase disks .SH SYNOPSIS @@ -78,11 +78,10 @@ PRNG option (mersenne|twister|isaac) \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 --git a/src/gui.c b/src/gui.c index ef7af8c..d1cb416 100644 --- a/src/gui.c +++ b/src/gui.c @@ -229,7 +229,7 @@ void nwipe_gui_init( void ) 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 ); diff --git a/src/options.c b/src/options.c index 5d63b88..eda478e 100644 --- a/src/options.c +++ b/src/options.c @@ -100,15 +100,6 @@ int nwipe_options_parse( int argc, char** argv ) { 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; @@ -352,7 +343,7 @@ void nwipe_options_log( void ) 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 --git a/src/version.c b/src/version.c index a543478..7cccdd5 100644 --- a/src/version.c +++ b/src/version.c @@ -4,7 +4,7 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char *version_string = "0.21"; +const char *version_string = "0.22"; const char *program_name = "nwipe"; const char *author_name = "Martijn van Brummelen"; const char *email_address = "git@brumit.nl"; @@ -14,3 +14,4 @@ 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.22 (based on DBAN's dwipe - Darik's Wipe)" diff --git a/src/version.h b/src/version.h index 0653610..48999f0 100644 --- a/src/version.h +++ b/src/version.h @@ -6,5 +6,6 @@ extern char *program_name; extern char *author_name; extern char *email_address; extern char *copyright; +extern char *banner; #endif/*__VERSION_H*/ From 0f06e91ce5ea9ddb5beff64ebd5fa99fd2d3e46e Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Sun, 12 Feb 2017 19:20:06 +0100 Subject: [PATCH 4/7] forgot ; --- src/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.c b/src/version.c index 7cccdd5..706e41a 100644 --- a/src/version.c +++ b/src/version.c @@ -14,4 +14,4 @@ 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.22 (based on DBAN's dwipe - Darik's Wipe)" +const char *banner = "nwipe 0.22 (based on DBAN's dwipe - Darik's Wipe)"; From 72c5cd8a0f21a867ef49ed69ec5416ff8dbe45d9 Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Sun, 12 Feb 2017 19:23:26 +0100 Subject: [PATCH 5/7] forgot to include version.h in gui.c --- src/gui.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui.c b/src/gui.c index d1cb416..4a765c6 100644 --- a/src/gui.c +++ b/src/gui.c @@ -41,6 +41,7 @@ #include "gui.h" #include "pass.h" #include "logging.h" +#include "version.h" #define NWIPE_GUI_PANE 8 From 1fce0eb936e059ce519d9178568972039ef4aacf Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Sun, 12 Feb 2017 19:53:32 +0100 Subject: [PATCH 6/7] make code more readable --- src/device.c | 2 +- src/isaac_rand.c | 56 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/device.c b/src/device.c index 472790a..32ec7ce 100644 --- a/src/device.c +++ b/src/device.c @@ -21,7 +21,7 @@ */ /* Why is this needed? Segfaults without it */ -#include +//#include #include "nwipe.h" #include "context.h" diff --git a/src/isaac_rand.c b/src/isaac_rand.c index 34d172e..c9220e0 100644 --- a/src/isaac_rand.c +++ b/src/isaac_rand.c @@ -29,8 +29,10 @@ void isaac(ctx) 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); m Date: Sun, 12 Feb 2017 20:14:55 +0100 Subject: [PATCH 7/7] remove unused netinet/in.h --- src/device.c | 3 --- src/gui.c | 3 --- src/method.c | 2 -- src/nwipe.c | 1 - src/pass.c | 3 --- 5 files changed, 12 deletions(-) diff --git a/src/device.c b/src/device.c index 32ec7ce..b9c15ab 100644 --- a/src/device.c +++ b/src/device.c @@ -20,9 +20,6 @@ * */ -/* Why is this needed? Segfaults without it */ -//#include - #include "nwipe.h" #include "context.h" #include "method.h" diff --git a/src/gui.c b/src/gui.c index 4a765c6..f9b8acd 100644 --- a/src/gui.c +++ b/src/gui.c @@ -30,9 +30,6 @@ * */ -/* Why is this needed? Segfaults without it */ -#include - #include "nwipe.h" #include "context.h" #include "method.h" diff --git a/src/method.c b/src/method.c index fed21d1..7639102 100644 --- a/src/method.c +++ b/src/method.c @@ -38,8 +38,6 @@ * */ -/* Why is this needed? Segfaults without it */ -#include #include "nwipe.h" #include "context.h" diff --git a/src/nwipe.c b/src/nwipe.c index 44d552c..65a1579 100644 --- a/src/nwipe.c +++ b/src/nwipe.c @@ -21,7 +21,6 @@ * */ -#include #include #include diff --git a/src/pass.c b/src/pass.c index 3c6dfab..418aec6 100644 --- a/src/pass.c +++ b/src/pass.c @@ -20,9 +20,6 @@ * */ -/* Why is this needed? Segfaults without it */ -#include - #include "nwipe.h" #include "context.h" #include "method.h"