Commit Graph

413 Commits

Author SHA1 Message Date
PartialVolume
57eeab2292 Update CHANGELOG.md Fixed obscure segfault 2020-04-01 20:22:07 +01:00
PartialVolume
c3756e0f53 Merge pull request #248 from PartialVolume/Fix_segfault_when_scrolling_drive_selection_window
Fix obscure segfault when resizing terminal
2020-04-01 20:00:26 +01:00
PartialVolume
d140feb94b Fix obscure segfault when resizing terminal
This was a very obscure segmentation fault I
stumbled across while testing the drive
selection window. I confirmed it exists
in all versions at least going back prior
to 0.24 and maybe a lot earlier.

It was a very tricky bug to track down as you
had to do some very specific things to cause it to
occur. Probably most people would not have seen
it, however for those that did, this was what you
needed to do to trigger it.

1. First you had to be wiping more than one drive.

2. Then you needed to scroll down to the bottom
drive in the list.

3. You then needed to minimise the vertical height
of the terminal so you could no longer see the
selected drive.

4. Then you needed to expand the vertical height
of the terminal. This last step would trigger a
segmentation fault and crash nwipe.

So, the theory. nwipe uses four variables to
allow you to scroll through multiple displayed
drives. These four variables are:

count = the number of enumerated drives.

slots = the number of available horizontal lines
        to display the drives. The number of slots
        varies depending upon vertical resizing
        of the terminal. So slots is calculated
        in real time.

focus = which drive the GUI '>' pointer is pointing to.

offset = A value between 0 and slots that describes
         what drives are displayed in the available
         slots.

offset is then used along with i in a for loop to index
the drive contexts. This is where the segfault
occurred.

The calculation failed to take correct account of a varying
number of slots so in the condition described above the
offset would create an index that was out of bounds.

So first I fixed the miss calculation and second I placed
an if statement that acts as a bounds checker so if
ever this code is changed by someone in the future and
they break the calculation the bounds checker 'if' statement
will log the details of the error and prevent a segfault which
is far easier to debug.
2020-04-01 19:50:04 +01:00
PartialVolume
62beaca8ac Merge pull request #247 from PartialVolume/Add_NVME_to_bus_types_and_make_bus_types_4_digits
Add NVME & VIRT to device types.
2020-03-31 15:20:06 +01:00
PartialVolume
497fcb73b5 Add NVME & VIRT to device types.
Added NVME and VIRT to device type table.

VIRT are virtual devices such as loop devices
created with losetup.

NVME for solid state storage devices.

Due to the longer device names used for NVME, I will
need to do some work on the device name in the selection
window so column alignment is maintained.
2020-03-31 15:14:41 +01:00
PartialVolume
00085b403e Merge pull request #246 from PartialVolume/Add_Green_Red_color_to_SUCCESS_FAILURE_messages
Visually enhance failure messages
2020-03-30 22:19:41 +01:00
PartialVolume
fea6facadc Visually enhance failure messages
When a drive fails display the failure message
with red text on a white background.

This makes it more visually obvious a drive
failure has occurred.
2020-03-30 22:02:54 +01:00
PartialVolume
186bd9e03b Update CHANGELOG.md 2020-03-30 20:42:47 +01:00
PartialVolume
f5db72a983 Merge pull request #244 from PartialVolume/Use_nomenclature_function
Use nwipe's nomenclature function
2020-03-30 16:20:13 +01:00
PartialVolume
030338f1bd Use nwipe's nomenclature function
Benefits include:

1. Standard fixed width output for disk
throughput, combined throughput and disk
capacity. Allows for better column alignment
when wiping multiple drives.

2. Removal of about 40 lines of duplicated code.
2020-03-30 16:01:16 +01:00
PartialVolume
eee523d3d1 Merge pull request #243 from PartialVolume/Make_percentage_fixed_width
Make percentage width fixed.
2020-03-30 14:56:07 +01:00
PartialVolume
c3642e8904 Make percentage width fixed.
For drives that are wiping the percentage
completion is displayed. To retain column
alignment when wiping multiple drives, the
percentage values from 0.01% to 9.99% are
displayed with a leading space, i.e
[ 9.99%, then 10.00% to 99.99% is displayed
as, i.e [10.01%, etc..
2020-03-30 14:49:14 +01:00
PartialVolume
16a3b3c487 Merge pull request #242 from PartialVolume/Combine_writing_syncing_etc_fields_in_GUI
Combine [writing][blanking] fields
2020-03-30 14:26:21 +01:00
PartialVolume
fa9eb6892b Combine [writing][blanking] fields
When wiping a drive a status message is displayed
that show [writing] or [syncing] or [verifying] or
[blanking] etc. Previously there were two bracketed
fields, [syncing] occupied one field and all the others
occupied the other field.

To conserve screen space they all occupy the same
bracketed field.

The bracketed field is also now a fixed length of
9 characters padded with spaces as necessary to maintain
column alignment when wiping multiple drives simultaneously.
2020-03-30 14:22:19 +01:00
PartialVolume
3ed8dfd708 Merge pull request #241 from PartialVolume/Stop_throughput_calculation_once_wipe_has_finished
Fix individual drive throughput running after a wipe has finished
2020-03-30 09:21:31 +01:00
PartialVolume
cbe959455a Fix individual drive throughput running after
a wipe has finished.

This problem was not seen when wiping multiple drives
of the same size as they all ended at the same time.
Also not seen when wiping  a single drive, but if you
wiped multiple drives of different sizes where the
drive wipes ended at different times then you could
see the throughput being calculated as steadily dropping
for a drive that had completed it's wipe.

Also fixed overall throughput. When all wipes had completed
overall throughput showed the throughput of the last drive
that finished. It should show 0 B/s as all wiping had
ceased. In the log table you will see individual drive
throughput and overall throughput which is the sum of
all the drives throughputs.
2020-03-30 09:14:00 +01:00
PartialVolume
8e52c926ab Update README.md, readlink ( coreutils package ) 2020-03-28 22:10:05 +00:00
PartialVolume
22b08d43c8 Update CHANGELOG.md, fix hyperlinks 2020-03-27 21:51:46 +00:00
PartialVolume
98775a4837 Merge pull request #240 from PartialVolume/fix_readlink_missing_message
Fix incorrect readlink error message
2020-03-27 21:43:48 +00:00
PartialVolume
4fe7f4a697 Fix incorrect readlink error message 2020-03-27 21:40:56 +00:00
PartialVolume
ddfa194ed9 Merge pull request #239 from PartialVolume/add_no_usb_option
Add --nousb option.
2020-03-27 21:03:02 +00:00
PartialVolume
b9a9386d2f Add --nousb option.
If you use the option --nousb, all USB devices will be ignored.
They won't show up in the GUI and they won't be wiped if you use
the --nogui --autonuke command. They will even be ignored if you
specifically name them on the command line.
2020-03-27 20:57:33 +00:00
PartialVolume
8430befdc3 Update README.md 2020-03-27 00:19:16 +00:00
PartialVolume
dc692735ce Update README.md 2020-03-27 00:16:57 +00:00
PartialVolume
4e4c37dd4a Update CHANGELOG.md 2020-03-26 20:36:18 +00:00
PartialVolume
ac0fe876a1 Merge pull request #237 from PartialVolume/Correct_disk_capacity_nomenclature
Fix incorrect disk capacity nomenclature.
2020-03-26 20:09:51 +00:00
PartialVolume
e46e80277d Fix incorrect disk capacity nomenclature.
I've always wondered, when you first view
all the drives, why drives above 999GB appeared
in their GB nomenclature instead of TB. For
instance a 2TB drive would appear as 2000GB.
Unlike other places in nwipe that does a proper
job of describing capacity just this one location
in the program was wrong.

This information was obtained by a call to a function
in libparted. Maybe when libparted was written there
was no such thing as a TByte drive ?? Who knows, so
anyway it was far easier to use nwipes build in function
called 'determine_C_B_nomenclature()' This provides us
with the correct nomenclature that is a fixed number of
digits (three) and prefixed with spaces so the length
is always the same. In the GUI this gives a nice
list when viewing multiple drives that appears in neat
columns.
2020-03-26 19:41:07 +00:00
PartialVolume
ac9757dfe7 Merge pull request #236 from PartialVolume/Fix_search_for_dmidecode
Fix search method for dmidecode
2020-03-25 23:08:07 +00:00
PartialVolume
7af0dd57c7 Fix search method for dmidecode 2020-03-25 22:58:51 +00:00
PartialVolume
14d5178013 Merge pull request #235 from PartialVolume/smartctl_directory_search-2
Fix the way I look for smartctl & readlink
2020-03-25 22:31:25 +00:00
PartialVolume
2446db741f Fix the way I look for smartctl & readlink 2020-03-25 22:26:43 +00:00
PartialVolume
081051c25f Merge pull request #234 from PartialVolume/smartctl_directory_search-1
fix smartctl directory search
2020-03-25 18:27:22 +00:00
PartialVolume
055b90d4c7 fix smartctl directory search 2020-03-25 18:20:06 +00:00
PartialVolume
9789c4748f Merge pull request #233 from PartialVolume/Check_directories_for_smartmontools_and_readlink
Search extra directories for smartctl & readlink
2020-03-25 17:41:18 +00:00
PartialVolume
a2f70661b8 Search extra directories for smartctl & readlink
This is mainly required for Debian sid if using
su instead of su - to run nwipe.
2020-03-25 17:35:14 +00:00
PartialVolume
bb0019fe40 Merge pull request #232 from PartialVolume/tidy_smartctl_and_readlink_warning_messages
Tidy the smartctl & readlink warning messages
2020-03-25 15:07:41 +00:00
PartialVolume
186ec9172c Tidy the smartctl & readlink warning messages 2020-03-25 15:02:40 +00:00
PartialVolume
415f43c975 Update README.md 2020-03-25 10:11:00 +00:00
PartialVolume
5809d0febd Merge pull request #231 from PartialVolume/Fix_duplicated_serial_no
Fix duplicated serial number
2020-03-24 23:12:29 +00:00
PartialVolume
fdf3140249 Fix duplicated serial number
If any drive doesn't have a serial number it's
serial number field was populated with the previous
drives serial number.

This is fixed by this patch.
2020-03-24 23:07:39 +00:00
PartialVolume
2f7979476b Update README.md readlink smartmontools 2020-03-24 22:41:44 +00:00
PartialVolume
c53a93ec9c Update README.md 2020-03-24 22:39:56 +00:00
PartialVolume
6943e35a33 Merge pull request #230 from PartialVolume/Get_device_bus_type_and_serial_number
Add serial number support for USB devices
2020-03-24 21:07:27 +00:00
PartialVolume
541a002a99 Add serial number support for USB devices
Add serial number support for USB devices for USB
to IDE/SATA adapters. Note this will only work
with USB IDE/SATA adapters that support ATA pass
through. See #149 for further details of
supported devices.

This patch requires readlink and smartmontools (smartctl)
to be installed. If not installed the serial number for
supported USB hardware will be missing.

The device type, i.e USB or ATA is now shown on the selection
and wipe windows.
2020-03-24 21:01:05 +00:00
PartialVolume
c29185999e Update CHANGELOG.md - Fix system info - Debian Sid 2020-03-22 22:53:15 +00:00
PartialVolume
fc406d2346 Merge pull request #229 from PartialVolume/Check_for_dmidecode_in_sbin
Check for dmidecode in /sbin
2020-03-22 22:43:56 +00:00
PartialVolume
0c4493e11c Check for dmidecode in /sbin
In Debian Sid dmidecode is not found as /sbin is not
searched when nwipe only specifies 'dmidecode', so
if it fails then it will next try /sbin/dmidecode
which is where it's normally located if it's installed.

In ubuntu etc, the sudo environment is setup so /sbin
is automatically searched.
2020-03-22 22:34:50 +00:00
PartialVolume
acf296d25d Merge pull request #228 from PartialVolume/Fix_visual_syncing_annoyance
Make the [syncing] a bit easier on the eyes
2020-03-22 16:56:39 +00:00
PartialVolume
2738522bb8 Make the [syncing] a bit easier on the eyes
I don't know if it's just me, but I'm not keen on the
way the status line length changes every few seconds
depending on whether nwipe is syncing or not. So
while still retaining the syncing message I think
it looks better if when not syncing, [syncing] is
replaced with [-------]. This keeps the status line
length pretty much constant and I find it easier on
my eyes.
2020-03-22 16:33:41 +00:00
PartialVolume
34d86e9c19 Merge pull request #227 from PartialVolume/Fix_inaccurate_throughput_calculation
Fix throughput so it shows the average throughput
2020-03-22 10:41:39 +00:00