mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: vddk: Atomicly chmod the password file.
Ensure we are chmodding the correct file, avoids possible races. Thanks: Pino Toscano.
This commit is contained in:
@@ -243,7 +243,7 @@ object
|
||||
let password_file = tmpdir // "password" in
|
||||
with_open_out password_file (
|
||||
fun chan ->
|
||||
chmod password_file 0o600;
|
||||
fchmod (descr_of_out_channel chan) 0o600;
|
||||
output_string chan password
|
||||
);
|
||||
(* nbdkit reads the password from the file *)
|
||||
|
||||
Reference in New Issue
Block a user