diff options
author | Richard Jones <rjones@redhat.com> | 2010-06-08 16:04:01 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-06-08 16:04:01 +0100 |
commit | ba39ced8804765705f4c61a92db0fddb8d672c7d (patch) | |
tree | 4daff51e2206afa0f8df822ab6a63086eb77c630 /daemon/file.c | |
parent | 1253f577fa162b9170b22f3c543167aa99795920 (diff) | |
download | libguestfs-ba39ced8804765705f4c61a92db0fddb8d672c7d.tar.gz libguestfs-ba39ced8804765705f4c61a92db0fddb8d672c7d.tar.xz libguestfs-ba39ced8804765705f4c61a92db0fddb8d672c7d.zip |
file: Fix file command on /dev/VG/LV paths (RHBZ#582484).
Previous commit 4df593496e116dfb635731c058b7627e81fc179c broke the
"file" command on logical volume paths, since these are symbolic
links. We *should* follow these (only).
This inadvertantly broke virt-inspector too, which indicates that
we need more regression testing in this area. Since carrying whole
Fedora images around could make the distribution even larger than
now, I'm not sure at the moment how to do this.
Thanks to Matt Booth for diagnosing this bug.
Diffstat (limited to 'daemon/file.c')
-rw-r--r-- | daemon/file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/file.c b/daemon/file.c index a55c6066..da899b6c 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -581,8 +581,13 @@ do_file (const char *path) } } + /* Which flags to use? For /dev paths, follow links because + * /dev/VG/LV is a symbolic link. + */ + const char *flags = is_dev ? "-zbsL" : "-zb"; + char *out, *err; - int r = command (&out, &err, "file", "-zbs", path, NULL); + int r = command (&out, &err, "file", flags, path, NULL); free (buf); if (r == -1) { |