[Libguestfs] [PATCH] inspect: Get architecture of Alpine Linux from /bin/busybox.

Pino Toscano ptoscano at redhat.com
Tue Jan 26 17:45:25 UTC 2016


On Tuesday 26 January 2016 15:54:46 Richard W.M. Jones wrote:
> All the files in /bin are links to busybox.  guestfs_file_architecture
> doesn't follow symlinks so it fails.  Therefore check /bin/busybox
> (not a symlink) to find the architecture.
> ---

While this patch looks okay in principle, I think it would be better
to just resolve the paths we are looking for: that is, do symlink
resolution in is_file, and use realpath to get the actual path before
passing it to file_architecture. If the file can be stat()ed, then it
is a relative symlink whose target we can read.

Patch coming in a minute.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160126/b517b2da/attachment.sig>


More information about the Libguestfs mailing list