1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

repart: Write temporary LUKS header to /var/tmp instead of /tmp

This is a relatively large file so let's not create it in memory.
This commit is contained in:
Daan De Meyer 2022-11-17 14:15:28 +01:00
parent 48ac1fd132
commit 0b75744d5c

View File

@ -3178,6 +3178,7 @@ static int partition_encrypt(Context *context, Partition *p, const char *node) {
const char *passphrase = NULL;
size_t passphrase_size = 0;
sd_id128_t uuid;
const char *vt;
int r;
assert(context);
@ -3194,7 +3195,11 @@ static int partition_encrypt(Context *context, Partition *p, const char *node) {
log_info("Encrypting future partition %" PRIu64 "...", p->partno);
r = fopen_temporary_child(NULL, &h, &hp);
r = var_tmp_dir(&vt);
if (r < 0)
return log_error_errno(r, "Failed to determine temporary files directory: %m");
r = fopen_temporary_child(vt, &h, &hp);
if (r < 0)
return log_error_errno(r, "Failed to create temporary LUKS header file: %m");