This is a relatively large file so let's not create it in memory.
const char *passphrase = NULL;
size_t passphrase_size = 0;
sd_id128_t uuid;
+ const char *vt;
int r;
assert(context);
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");