detached 4909ace

fix(partitioning): use printf instead of here-string for secure LUKS password handling

commit
4909acec0b84dd2a04072efc684eac3029e4f91d
author
bnema · · 2025-10-20 18:44 UTC
parent
fa93e6f
signature
unsigned
1 file · +4 -3
M install/partitioning/format.sh +4 -3
@@ -27,19 +27,20 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
2727 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2828
2929 # Setup LUKS with Argon2id and 2000ms iteration time (using user password)
30- cryptsetup luksFormat \
30+ # Use printf to avoid trailing newline that <<< adds
31+ printf '%s' "$ARCHUP_PASSWORD" | cryptsetup luksFormat \
3132 --type luks2 \
3233 --batch-mode \
3334 --pbkdf argon2id \
3435 --iter-time 2000 \
3536 --label ARCHUP_LUKS \
3637 --key-file - \
37- "$ARCHUP_ROOT_PART" <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
38+ "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
3839
3940 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
4041
4142 # Open the encrypted container
42- cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
43+ printf '%s' "$ARCHUP_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4344
4445 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
4546
@@ -27,19 +27,20 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
27 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&127 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28 28
29 # Setup LUKS with Argon2id and 2000ms iteration time (using user password)29 # Setup LUKS with Argon2id and 2000ms iteration time (using user password)
30- cryptsetup luksFormat \30+ # Use printf to avoid trailing newline that <<< adds
31+ printf '%s' "$ARCHUP_PASSWORD" | cryptsetup luksFormat \
31 --type luks2 \32 --type luks2 \
32 --batch-mode \33 --batch-mode \
33 --pbkdf argon2id \34 --pbkdf argon2id \
34 --iter-time 2000 \35 --iter-time 2000 \
35 --label ARCHUP_LUKS \36 --label ARCHUP_LUKS \
36 --key-file - \37 --key-file - \
37- "$ARCHUP_ROOT_PART" <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&138+ "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
38 39
39 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"40 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
40 41
41 # Open the encrypted container42 # Open the encrypted container
42- cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&143+ printf '%s' "$ARCHUP_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
43 44
44 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"45 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
45 46

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close