mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: ova: Make OVA directory public readable to work around libvirt bug (RHBZ#1375157).
Only do this if running as root and if the backend is set to libvirt.
This commit is contained in:
@@ -104,6 +104,19 @@ object
|
||||
(* Exploded path must be absolute (RHBZ#1155121). *)
|
||||
let exploded = absolute_path exploded in
|
||||
|
||||
(* If virt-v2v is running as root, and the backend is libvirt, then
|
||||
* we have to chmod the directory to 0755 and files to 0644
|
||||
* so it is readable by qemu.qemu. This is libvirt bug RHBZ#890291.
|
||||
*)
|
||||
if Unix.geteuid () = 0 then (
|
||||
let libguestfs_backend = (open_guestfs ())#get_backend () in
|
||||
if libguestfs_backend = "libvirt" then (
|
||||
warning (f_"making OVA directory public readable to work around libvirt bug https://bugzilla.redhat.com/1045069");
|
||||
let cmd = [ "chmod"; "-R"; "go=u,go-w"; exploded ] in
|
||||
ignore (run_command cmd)
|
||||
)
|
||||
);
|
||||
|
||||
(* Find files in [dir] ending with [ext]. *)
|
||||
let find_files dir ext =
|
||||
let rec loop = function
|
||||
|
||||
Reference in New Issue
Block a user