Skip to content

Commit be91d2e

Browse files
committed
mantle/qemu: Don't directly setenv()
Invoking `setenv()` in multi-threaded processes is unsafe: rust-lang/rust#24741 https://sourceware.org/bugzilla/show_bug.cgi?id=4887#c9 https://bugs.freedesktop.org/show_bug.cgi?id=65681
1 parent 497e779 commit be91d2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mantle/platform/qemu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ func setupIgnition(confPath string, diskImagePath string) error {
282282
// Set guestfish backend to direct in order to avoid libvirt as backend.
283283
// Using libvirt can lead to permission denied issues if it does not have access
284284
// rights to the qcow image
285-
os.Setenv("LIBGUESTFS_BACKEND", "direct")
286285
cmd := exec.Command("guestfish", "--listen", "-a", diskImagePath)
286+
cmd.Env = append(os.Environ(), "LIBGUESTFS_BACKEND=direct")
287287
stdout, err := cmd.StdoutPipe()
288288
if err != nil {
289289
return fmt.Errorf("getting stdout pipe: %v", err)

0 commit comments

Comments
 (0)