Skip to content

Commit

Permalink
cryptenroll: Fix reading keyfile from socket
Browse files Browse the repository at this point in the history
systemd-cryptenroll uses the READ_FULL_FILE_CONNECT_SOCKET flag when
reading the keyfile to also allow reading it from a socket. But it also
sets the offset to 0, causing an unnecessary seek to the beginning of
the newly opened keyfile and disables socket support again, as these do
not support seeking.

Disable seeking entirely to remove the unneeded seek and restore support
for reading the keyfile from a socket again as with systemd-cryptsetup.
  • Loading branch information
Felix Riemann authored and bluca committed Feb 6, 2024
1 parent d50f58d commit 0119370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cryptenroll/cryptenroll.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ static int load_volume_key_keyfile(
r = read_full_file_full(
AT_FDCWD,
arg_unlock_keyfile,
0,
UINT64_MAX,
SIZE_MAX,
READ_FULL_FILE_SECURE|READ_FULL_FILE_WARN_WORLD_READABLE|READ_FULL_FILE_CONNECT_SOCKET,
NULL,
Expand Down

0 comments on commit 0119370

Please sign in to comment.