Fix sorting logic and clean up redundant conditionals#6
Open
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Open
Fix sorting logic and clean up redundant conditionals#6assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Conversation
ArrayBolt3
reviewed
Apr 14, 2026
ArrayBolt3
left a comment
There was a problem hiding this comment.
Accepted in ArrayBolt3@1fb6160 with an added comment and a couple of string changes.
| else | ||
| GRUB_DISTRIBUTOR="$grub_distributor_appendix" | ||
| fi | ||
| grub_distributor_appendix="LIVE Mode | USER Session | For disposable use" |
There was a problem hiding this comment.
"For" should not be added to "disposable use". (It was mistakenly present in a different script in this repo, which is probably why Claude decided to add it here.)
- Fix ghost empty first element in proc_mount_path_list (and sibling arrays): the while loop in populate_proc_mount_lists appends a trailing newline to proc_mount_annotated_str, and the here-string adds another; sort sees the resulting empty line and places it first in C locale, creating a spurious empty element at index 0. Fix by stripping the trailing newline before sorting. - Fix ghost empty entry in lsblk_path_list when parsing multi-mount devices: lsblk encodes newline-separated mount paths with trailing \x0a, which after printf %b decoding and readarray via here-string produces a trailing empty array element. Fix by skipping empty entries in the lsblk path loop. - Fix misleading comment that described STX as having the "second-highest sorting order" in C locale; STX (0x02) actually has one of the lowest byte values, meaning it sorts earliest. https://claude.ai/code/session_01WHDK9nRRjJnnUtUUBswH1D
0d5b480 to
273d0d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several bugs and improves code clarity across the grub-live hardening scripts and GRUB configuration files.
Key Changes
usr/libexec/grub-live/live-hardener:
proc_mount_annotated_strto prevent sort from creating ghost empty elementsallow_hide_submountsin local variable listlsblk_raw_path_listcaused by trailing newline escapesoverlay_mount_list_stris empty to avoid unnecessary processingskip_dir_overlayis true to prevent redundant directory traversaletc/grub.d/10_20_linux_live and etc/grub.d/10_60_linux_live_advanced:
GRUB_DISTRIBUTORassignment to directly usegrub_distributor_appendixinstead of conditional checksetc/grub.d/45_debugging:
$@to$*for proper quoting behaviorNotable Implementation Details
https://claude.ai/code/session_01WHDK9nRRjJnnUtUUBswH1D