Commit Graph

682 Commits

Author SHA1 Message Date
PartialVolume
65bc03da9a Merge pull request #410 from PartialVolume/fix_segfault_when_logfile_cannot_be_created_due_to_permissions
Fix obscure segfault when --logfile option used with a non writable directory.
2022-03-15 23:07:16 +00:00
PartialVolume
949f2b25e5 Bump version 2022-03-15 23:05:02 +00:00
PartialVolume
62e7876c74 Fix obscure segfault when --logfile option used.
If you use the --logfile option but specify a filename
that will be created in a directory that is not writable,
for instance, a system directory such as /proc/sys/ or
your current directory happens to be a system directory
that you are running nwipe from while not specifying a
writable path for the log file then nwipe would exit with
a segfault.

This is now fixed and if the logfile cannot be created
or opened then an appropriate message is displayed and
nwipe is aborted.
2022-03-15 19:58:13 +00:00
PartialVolume
648cad7645 Merge pull request #409 from PartialVolume/fix_nwipe_not_exiting_when_konsole_exited_before_nwipe_during_wipe
Fix_nwipe_not_exiting_when_using_konsole
2022-03-03 20:06:13 +00:00
PartialVolume
791c6f3975 Fix_nwipe_not_exiting_when_using_konsole
This fixes a issue related to konsole and terminals based on Konsole,
like cool retro terminal. If you exit the terminal before exiting nwipe,
nwipe will then continue running in the background but detached from any
terminals input/output. This causes a call to halfdelay()/getch() to
return immediately, thus removing the delay and causing the thread to
run at full speed causing 100% CPU in a core. This requires nwipe to
then be killed manually. This patch is related to the last patch in
that both patches do much the same thing but the previous patch fixes
the problem when nwipe is sitting at the drive selection screen, while
this patch fixes the problem during a wipe.

This problem would only be seen in specific KDE konsole related
terminals and only if you do not exit nwipe by using nwipe's control c
to abort or use the space bar on completion of the wipe.

Much like the same check we perform in the nwipe_gui_select() function,
here we check that we are not looping any faster than as defined by the
halfdelay() function, typically this loop runs at 10 times a second.
This check makes sure that if the loop runs faster than double this
value i.e 20 times a second then the program exits. This check is
therefore determining whether the getch() function is returning
immediately rather than blocking for the defined period of 100ms.
Why is this necessary? Some terminals (konsole & deriviatives) that are
exited while nwipe is still running fail to terminate nwipe this causes
the halfdelay()/getch() functions to immediately fail causing the loop
frequency to drastically increase. We detect that speed increase here
and therefore close down nwipe. This doesn't affect the use of the tmux
terminal by which you can detach and reattach to running nwipe
processes. The tmux terminal will still work correctly when a nwipe
session is detached.
2022-03-03 19:48:44 +00:00
PartialVolume
3f3ea5e04b Merge pull request #408 from PartialVolume/Fix_100%CPU_when_konsole_closed
Fixes a 100% CPU usage on Konsole based terminal
2022-03-02 19:39:54 +00:00
PartialVolume
175b246291 Fixes a 100% CPU usage on Konsole based terminal
when Konsole terminal exited while nwipe is sitting at the
drive selection screen.

To avoid 100% CPU usage, check for a runaway condition caused by the
function "keystroke = getch() that immediately returns an error
condition. We check for an error condition because getch() returns a
ERR value when the timeout value "timeout( 250 );" expires as well as
when a real error occurs. We can't differentiate from normal operation
and a failure of the getch function to block for the specified period
of timeout. So here we check the while loop hasn't exceeded the number
of expected iterations per second ie. a timeout(250) block value of
250ms means we should not see any more than (1000/250) = 4 iterations.
We double this to 8 to allow a little tolerance. Why is this necessary?
It's been found that in KDE konsole and other terminals based on the QT
terminal engine exiting the terminal without first existing nwipe
results in nwipe remaining running but detached from any interface
which causes getch to fail and its associated timeout. So the CPU or
CPU core rises to 100%. Here we detect that failure and exit nwipe
gracefully with the appropriate error. This does not affect use of
tmux for attaching or detaching from a running nwipe session when
sitting at the selection screen. All other terminals correctly
terminate nwipe when the terminal itself is exited.
2022-03-02 19:34:05 +00:00
PartialVolume
58576f8191 Merge pull request #407 from PartialVolume/Fix_temperature_update_in_drive_selection_window
Fix temperature update in drive selection window
2022-02-25 22:47:06 +00:00
PartialVolume
1384d8a6d7 Fix temperature update in drive selection window
This fixes a problem where the drive temperature is not updated
automatically in the drive selection window only. The temperature
is however updated every correctly every 60 seconds during a wipe in
the wipe status window.

This bug would probably never be noticed by most people as usually the
drive temperature changes slowly and only rises once a wipe has started.

The only time I imagine it would have been noticed would have been if
the drive temperature was already high and you were trying to reduce the
temperature by cooling before starting a wipe.

This has now been corrected so that the temperature in the drive
selection window is updated every 60 seconds.
2022-02-25 22:40:07 +00:00
PartialVolume
7f16dd3f74 Merge pull request #406 from PartialVolume/fix_spurious_message_on_abort_before_wipe_starts_control_c
Fix spurious message on abort before wipe.
2022-02-25 15:47:18 +00:00
PartialVolume
14f70661d8 Fix spurious message on abort before wipe.
This patch fixes a minor display issue that occurs when
a user aborts a wipe before a wipe has started. It only occurs
if the user had selected one or more drives for wipe and then
aborted before starting the wipe. The spurious message only
occurs in a virtual terminal, i.e. /dev/tty1, /dev/tty2, /dev/console
It does not occur in terminal applications such as konsole, xterm,
terminator etc.

The spurious message that appears in the main window, states that
"/dev/sdxyz 100% complete" along with garbage values in the statistics
window. The message appears for a fraction of a second before being
replaced with the textual log information that correctly states that
the user aborted and no wipe was started.

Basically the gui status information update function tries to update
the data when the wipe hasn't even started. The fix is to only update
the statistics information only if a wipe has started by checking the
'global_wipe_status' value which indicates whether any wipe started. '1'
indicates that a wipe has started, else '0' if no wipe has started.
2022-02-25 15:38:42 +00:00
PartialVolume
dcd1d100ca Merge pull request #404 from PartialVolume/master
Bump minor version to 0.32.023
2022-01-13 20:31:11 +00:00
PartialVolume
334bcadae1 Bump minor version 2022-01-13 20:20:58 +00:00
PartialVolume
dff450c49d Merge pull request #403 from martijnvanbrummelen/revert-402-revert-401-update_isaac64_command_line_options_help_and_man_page
Revert "Revert "Isaac64, update options, help and man page""
2022-01-13 20:05:43 +00:00
PartialVolume
40569ce1c0 Revert "Revert "Isaac64, update options, help and man page"" 2022-01-13 20:03:47 +00:00
PartialVolume
34fca0747a Merge pull request #402 from martijnvanbrummelen/revert-401-update_isaac64_command_line_options_help_and_man_page
Revert "Isaac64, update options, help and man page" Checks failed.
2022-01-13 19:32:36 +00:00
PartialVolume
110f62de00 Revert "Isaac64, update options, help and man page" 2022-01-13 19:30:10 +00:00
PartialVolume
1705b31ae8 Merge pull request #401 from PartialVolume/update_isaac64_command_line_options_help_and_man_page
Isaac64, update options, help and man page
2022-01-13 19:27:52 +00:00
PartialVolume
1e43f17650 Isaac64, update options, help and man page 2022-01-13 19:25:43 +00:00
PartialVolume
8313506ec5 Merge pull request #400 from PartialVolume/Fix_summary_table_on_specific_failure
Fix obscure incorrect summary table status
2022-01-12 21:14:22 +00:00
PartialVolume
978c4e9c8b Fix obscure incorrect summary table status
If the drive becomes non responsive during the wipe, the MB/s will
slowly drop towards 0MB/s and will display a FAILURE -1 error. The logs
will display errors and nwipe's return status will be non zero, however
the summary table may display erased rather than FAILURE, this is because
the wipe thread exited prematurely without setting the pass error.

This fixes the error by checking the context's result status, i.e non zero
on failure and if pass equals zero it makes pass equal to one. This is
then picked up by the summary table log code which then marks the status
correctly as FAILURE in the summary table.
2022-01-12 21:03:58 +00:00
PartialVolume
5ca7458b8c Bump version to 0.32.021 2022-01-09 15:18:32 +00:00
PartialVolume
0bc79f9feb Merge pull request #399 from chkboom/gutmann
Random passes in the Gutmann method should not be rearranged.
2022-01-09 15:16:05 +00:00
AK-47
0b959b62da Random passes in the Gutmann method should not be rearranged.
https://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html
"... random passes before and after the erase process, and by performing the deterministic passes in random order ..."
"The deterministic patterns between the random writes are permuted before the write is performed, ..."
2022-01-08 12:50:18 +11:00
PartialVolume
5e9ff6dfa5 Bumped version and year. 2022-01-06 23:37:02 +00:00
PartialVolume
d964c9245d Merge pull request #398 from chkboom/isaac64
Added ISAAC-64 PRNG for 64-bit systems.
2022-01-06 23:32:56 +00:00
AK-47
aa2c7727c4 Removed asserts and make "remain" const.
Attempt to fix formatting.
2022-01-07 00:28:39 +11:00
AK-47
3094fc2fa7 Leave the blanking setting alone when changing the verification setting. 2022-01-06 21:42:01 +11:00
AK-47
85fbba947a Select ISAAC-64 by default on a >=64-bit CPU.
Otherwise choose ISAAC instead of Mersenne Twister.
2022-01-06 20:57:18 +11:00
AK-47
6dff23d6b2 Significantly improved ISAAC and ISAAC-64 performance.
Each ISAAC call generates a block of integers, but only the first integer was used before the PRNG was called again.
This resulted in most of the random numbers being wasted and more calls to the PRNG than was necessary.
Also fixed some segmentation faults in ISAAC-64 code.
2022-01-06 13:55:00 +11:00
AK-47
76ca47f2cb Added ISAAC-64 PRNG for 64-bit systems.
Use RANDIZL=8 as recommended by ISAAC author.
Fixed possible buffer overflow in nwipe_isaac_read().
Slight performance improvement.
2022-01-06 01:36:12 +11:00
PartialVolume
fe9666bd41 Merge pull request #395 from Firminator/patch-2
Update README.md
2021-12-13 09:12:04 +00:00
Firminator
a19e07bd1b Update README.md
* remove redundant paragraphs and information especially regarding ShredOS
* move certain paragraphs around to streamline the readme and for better readability
* update links
* some minor changes
2021-12-13 00:33:30 -05:00
PartialVolume
c4430f149c Merge pull request #394 from PartialVolume/Mitigate_against_smartctls_inconsistent_use_of_case_in_labelling
Fix missing serial number on SAS drive. Fixes #384
2021-12-12 20:28:08 +00:00
PartialVolume
a83a27f8e5 Fix missing serial number on SAS drive
This was caused by inconsistent labeling of the
serial number by smartctl. In a majority of cases
smartctl would output serial number data using
the label "Serial Number:" however on a SAS
drive we found that smartctl output the label
as "Serial number:" i.e. differs with a lower
case 'n'. Unfortunately we were doing a case
sensitive search for "Serial Number" so the result
being the serial number was not found.

This patch converts both strings in the search
to lower case before searching.

In addition a new field was added to the
anonymize list, "logical unit id:" so when the
-q option is used "serial number", "lu wwn device id:"
and "logical unit id:" are all now anonymized in the
smartctl debug data.
2021-12-12 20:22:35 +00:00
PartialVolume
254a0efd2c Merge pull request #393 from PartialVolume/Improve_GUI_thread_cancellation_eror_handling
Improve GUI thread cancellation messaging
2021-12-08 23:47:38 +00:00
PartialVolume
323fc38631 Improve GUI thread cancellation messaging
If pthread_join failed, nwipe would report an error
but would also report that the thread had been
cancelled. This has been corrected so that only
the error message is displayed in a fault condition.
2021-12-08 23:43:01 +00:00
PartialVolume
7f547e7ccb Merge pull request #392 from PartialVolume/Improve_thread_cancellation_error_reporting
Improve thread cancellation error reporting
2021-12-07 23:17:25 +00:00
PartialVolume
c433326c9f Improve thread cancellation error reporting
Check for specific errors.
Add retry loop with timeout for pthread_join.
2021-12-07 23:10:20 +00:00
PartialVolume
4351b3db5d Merge pull request #391 from PartialVolume/Fix_use_of_modprobe_on_Debian_11_part2
Would help if I explicitly stated the paths ;-)
2021-12-02 22:51:48 +00:00
PartialVolume
5eb43855c7 Would help if I explicitly stated the paths :'-) 2021-12-02 22:47:48 +00:00
PartialVolume
86174b227d Merge pull request #390 from PartialVolume/Fix_use_of_modprobe_on_Debian_11
Check multiple paths for modprobe
Fixes #389
2021-12-02 22:34:09 +00:00
PartialVolume
acba2c8065 Check multiple paths for modprobe
Particularly relevant to Debian which when logged in as root
doesn't put /sbin in the $PATH environment setting.

This might have caused temperatures to not be available on Debian
systems, but not necessarily on distros based on Debian like
Ubuntu which would have worked ok.
2021-12-02 22:30:39 +00:00
PartialVolume
0d3e1af83d Merge pull request #388 from PartialVolume/Fix_second_occurence_of_incorrect_specifier
Fix 2nd occurrence of incorrect format specifier.
2021-12-01 19:45:20 +00:00
PartialVolume
981f666150 Fix 2nd occurrence of incorrect format specifier.
Causing incorrect sect/block/device size to be
printed in nwipe_log but only for 32 bit builds.
2021-12-01 19:42:28 +00:00
PartialVolume
4f531e65db Merge pull request #387 from PartialVolume/Fix_nwipe_log_format_specifier_incorrect
Fix nwipe log format specifier incorrect
2021-12-01 19:33:16 +00:00
PartialVolume
181ef543de nwipe_log format specifier doesn't match variable.
The format specifier didn't match the size of the variable that holds
c2[i]->device_sector_size which is an int. This didn't appear to cause
a problem with reporting in a 64 bit build. It does cause a problem in
a 32 bit build displaying a very large & incorrect number for sector,
block and device sizes.

This doesn't cause any issues with the overall function, simply
incorrect sector, block and device sizes in 32 bit builds as displayed
in the nwipe log.

I also changed the signed long long for c2[i]->device _size to a
unsigned long long as there is little point in a negative device size.
2021-12-01 19:20:34 +00:00
PartialVolume
aab863ea7d Update ShredOS link 2021-12-01 05:50:34 +00:00
PartialVolume
ef06fed886 Merge pull request #383 from Firminator/patch-1
Update options.c with additional infor for -q
2021-11-18 15:34:05 +00:00
Firminator
6396825eb6 Update options.c
* added additional info for -q, i.e. what data is being removed from GUI and logs
* removed superfluous new line break
2021-11-18 10:11:03 -05:00