From 437315669f5fe38f90abb8d6f4da9ea60b9f6c12 Mon Sep 17 00:00:00 2001 From: Alexander Seiler Date: Fri, 9 Apr 2021 05:00:43 +0200 Subject: Fix typo that causes crash when creating encrypted LUKS partition (closes #248) --- archinstall/lib/luks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py index b076ac9b..561d4d6e 100644 --- a/archinstall/lib/luks.py +++ b/archinstall/lib/luks.py @@ -127,7 +127,7 @@ class luks2(): os.path.basename(mountpoint) # TODO: Raise exception instead? wait_timer = time.time() - while pathlib.Paht(partition.path).exists() is False and time.time() - wait_timer < 10: + while pathlib.Path(partition.path).exists() is False and time.time() - wait_timer < 10: time.sleep(0.025) sys_command(f'/usr/bin/cryptsetup open {partition.path} {mountpoint} --key-file {os.path.abspath(key_file)} --type luks2') -- cgit v1.2.3-70-g09d2 From acc2dac6527b5f7553a7066f80cc0680d328d31e Mon Sep 17 00:00:00 2001 From: Insanemal Date: Fri, 9 Apr 2021 13:44:51 +1000 Subject: Off by one in generic_selection out of bounds check Out of bounds check in generic_selection is using >= on list. Lists are zero based. If you put in a value that equals the number of items in the list you get an out of bounds error. Removed the equals part of the test as last item in list/dictionary items is len(list)-1 not len(list) --- archinstall/lib/user_interaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 3830962c..f8585595 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -184,7 +184,7 @@ def generic_select(options, input_text="Select one of the above by index or abso return None elif selected_option.isdigit(): selected_option = int(selected_option) - if selected_option >= len(options): + if selected_option > len(options): raise RequirementError(f'Selected option "{selected_option}" is out of range') selected_option = options[selected_option] elif selected_option in options: -- cgit v1.2.3-70-g09d2