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.
Bug 1151897 - virt-ls --checksum: checksum for soft link is wrong, the soft link have no checksum value output
Summary: virt-ls --checksum: checksum for soft link is wrong, the soft link have no ch...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1151898
TreeView+ depends on / blocked
 
Reported: 2014-10-13 02:28 UTC by Lingfei Kong
Modified: 2014-10-20 09:32 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1151898 (view as bug list)
Environment:
Last Closed: 2014-10-20 09:32:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lingfei Kong 2014-10-13 02:28:06 UTC
Description of problem:
checksum for soft link is wrong, the soft link have no checksum value output. 
Both md5sum and sha*sum can give checksum value for soft link. So the best way is also provide checksum value for soft link.

Version-Release number of selected component (if applicable):
libguestfs-1.27.62-1.1.el7


How reproducible:
100%


Steps to Reproduce:
#virt-ls -a rhel.img /etc -lR --checksum


Actual results:
.....
- 0644        447 dbc1e6da7574717bd3f7a02f98252c4c /etc/selinux/config
...
l 0777         17 /etc/sysconfig/selinux -> ../selinux/config
....


Expected results:
.....
- 0644        447 dbc1e6da7574717bd3f7a02f98252c4c /etc/selinux/config
...
l 0777         17 dbc1e6da7574717bd3f7a02f98252c4c /etc/sysconfig/selinux  -> ../selinux/config
....


Additional info:

Comment 1 Pino Toscano 2014-10-17 09:56:27 UTC
Checksum is currently done only for regular files, and symlinks are not regular files.

I do not think we should dereference them, since
a) if the symlink target exists in the guest, its checksum would be calculated more than once (once for the file itself, plus once for every symlink pointing to it)
b) if the symlink target does not exists, then there would be a mismatch in the output (one field less) between such kind of symlink and those pointing to existing files

Another case is that you might list just a subdirectory of a guest, with a symlink in it pointing to a file outside that subdirectory; say:
  $ virt-ls ... /etc
  [...]
  l 0777         10 /etc/vmlinuz  -> ../vmlinuz
then I think it still might be correct to not look at anything outout the subdirectory requested.

Comment 2 Lingfei Kong 2014-10-18 03:06:56 UTC
(In reply to Pino Toscano from comment #1)
> Checksum is currently done only for regular files, and symlinks are not
> regular files.
> 
> I do not think we should dereference them, since
> a) if the symlink target exists in the guest, its checksum would be
> calculated more than once (once for the file itself, plus once for every
> symlink pointing to it)
> b) if the symlink target does not exists, then there would be a mismatch in
> the output (one field less) between such kind of symlink and those pointing
> to existing files
> 
> Another case is that you might list just a subdirectory of a guest, with a
> symlink in it pointing to a file outside that subdirectory; say:
>   $ virt-ls ... /etc
>   [...]
>   l 0777         10 /etc/vmlinuz  -> ../vmlinuz
> then I think it still might be correct to not look at anything outout the
> subdirectory requested.

Thanks for your explanation. I agree with you to close it as NOTABUG.

Comment 3 Richard W.M. Jones 2014-10-20 09:32:41 UTC
Closing per comment 2.


Note You need to log in before you can comment on or make changes to this bug.