loader: check path read access
So we can provide a meaningful error message in case the provided path is not accessible to running process.
e.g: running HOME=/root osinfo-query os we would get
Error loading OS data: Unexpected file type
and now we get
Error loading OS data: Can't read file /root/.config/osinfo
This error was first hit with v2v [0] that was leaking $USER and $HOME
of root user when osinfo-query as vsdm user with sudo -c vdsm
. The
example above is a simple way to show lack of permision of
osinfo-query to read the root's $HOME.
[0] https://bugzilla.redhat.com/show_bug.cgi?id=1901423
Resolves:https://bugzilla.redhat.com/show_bug.cgi?id=1902720 Signed-off-by: Victor Toso victortoso@redhat.com