Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
As described in the man page: "lstatnslist/lstatlist path names", where all files are in the directory "path". "names" is the list of files from this directory.
But In RHEL7.1, results have nothing to do with "path" in the cases where "name" is absolute paths.
Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.28.1-1.17.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1.add an image, mount the root filesystem
#guestfish -a rhel-guest-image-7.0-20140926.0.x86_64.qcow2
><fs> run
><fs> mount /dev/sda1
2.list the files in "/home"
><fs> ll /home
total 4
drwxr-xr-x. 2 root root 6 Mar 13 2014 .
dr-xr-xr-x. 17 root root 4096 Dec 15 08:48 ..
3.use "lstatlist" to "lstat" on multiple files
><fs> lstatnslist /home "/bin /root"
[0] = {
st_dev: 2064
st_ino: 197
st_mode: 41471
st_nlink: 1
st_uid: 0
st_gid: 0
st_rdev: 0
st_size: 7
st_blksize: 4096
st_blocks: 8
st_atime_sec: 1418556601
st_atime_nsec: 0
st_mtime_sec: 1417173747
st_mtime_nsec: 0
st_ctime_sec: 1417173747
st_ctime_nsec: 0
st_spare1: 0
st_spare2: 0
st_spare3: 0
st_spare4: 0
st_spare5: 0
st_spare6: 0
}
[1] = {
st_dev: 2064
st_ino: 603
st_mode: 16868
st_nlink: 2
st_uid: 0
st_gid: 0
st_rdev: 0
st_size: 4096
st_blksize: 4096
st_blocks: 8
st_atime_sec: 1418610114
st_atime_nsec: 0
st_mtime_sec: 1418611447
st_mtime_nsec: 0
st_ctime_sec: 1418611447
st_ctime_nsec: 0
st_spare1: 0
st_spare2: 0
st_spare3: 0
st_spare4: 0
st_spare5: 0
st_spare6: 0
}
Actual results:
as described above
Expected results:
"/bin" and "/root" are not files in "/home". So the results should be like this:
[0] = {
st_dev: 0
st_ino: -1
st_mode: 0
st_nlink: 0
st_uid: 0
st_gid: 0
st_rdev: 0
st_size: 0
st_blksize: 0
st_blocks: 0
st_atime_sec: 0
st_atime_nsec: 0
st_mtime_sec: 0
st_mtime_nsec: 0
st_ctime_sec: 0
st_ctime_nsec: 0
st_spare1: 0
st_spare2: 0
st_spare3: 0
st_spare4: 0
st_spare5: 0
st_spare6: 0
}
[1] = {
st_dev: 0
st_ino: -1
st_mode: 0
st_nlink: 0
st_uid: 0
st_gid: 0
st_rdev: 0
st_size: 0
st_blksize: 0
st_blocks: 0
st_atime_sec: 0
st_atime_nsec: 0
st_mtime_sec: 0
st_mtime_nsec: 0
st_ctime_sec: 0
st_ctime_nsec: 0
st_spare1: 0
st_spare2: 0
st_spare3: 0
st_spare4: 0
st_spare5: 0
st_spare6: 0
}
Additional info:
Comment 1Richard W.M. Jones
2014-12-16 09:53:22 UTC
I guess the answer is "don't do that" :-) However yes we can add
a check to make sure if you use the API wrongly it will give you an
error instead.
Moving to 7.2 because the API does currently work if used correctly.
Verified with the packages:
libguestfs-1.32.5-6.el7.x86_64
Verify steps:
1. Prepare a RHEL guest image:
RHEL-Server-7.2-64-hvm.raw
2.
# guestfish -a RHEL-Server-7.2-64-hvm.raw -i
><fs> ll /home/
total 4
drwxr-xr-x. 2 root root 6 May 25 2015 .
dr-xr-xr-x. 17 root root 4096 Oct 31 2015 ..
><fs> lstatnslist /home "/bin /root"
libguestfs: error: lstatnslist: names: '/bin' is not a file name
It gives an obvious error as above.
So verified.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHSA-2016-2576.html