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 2209279 - RFE: 'guestfish --inspector' should recognize device pathnames like '/dev/mapper/rhel boot--73--75--123-root' with "--key"
Summary: RFE: 'guestfish --inspector' should recognize device pathnames like '/dev/map...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libguestfs
Version: 9.2
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On: 2168506
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-23 10:28 UTC by Laszlo Ersek
Modified: 2023-11-07 09:03 UTC (History)
15 users (show)

Fixed In Version: libguestfs-1.50.1-6.el9
Doc Type: Enhancement
Doc Text:
Clone Of: 2168506
Environment:
Last Closed: 2023-11-07 08:24:21 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/rpms libguestfs merge_requests 41 0 None opened let "guestfish -i" recognize "--key /dev/mapper/VG-LV:key:password"; reenable quickcheck (RHBZ#2209279) 2023-05-25 09:28:14 UTC
Gitlab redhat/centos-stream/rpms libguestfs merge_requests 42 0 None opened fix "osci.brew-build.rpminspect.static-analysis" gating test 2023-06-07 06:19:20 UTC
Red Hat Issue Tracker RHELPLAN-157919 0 None None None 2023-05-23 10:30:22 UTC
Red Hat Product Errata RHBA-2023:6327 0 None None None 2023-11-07 08:24:29 UTC

Description Laszlo Ersek 2023-05-23 10:28:26 UTC
+++ This bug was initially created as a clone of Bug #2168506 +++

* Description of problem:
'guestfish --inspector' should recognize device pathnames like '/dev/mapper/rhel boot--73--75--123-root' in related keys option

* Version-Release number of selected component (if applicable):
libguestfs-1.48.4-4.el9.x86_64

* How reproducible:
100%

* Steps to Reproduce:
1.Prepare a guest with LUKS-on-LVM scheme
# lsblk
NAME                                            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sda                                               8:0    0   16G  0 disk  
├─sda1                                            8:1    0    1G  0 part  /boot
└─sda2                                            8:2    0   15G  0 part  
  ├─rhel_bootp--73--75--123-root                253:0    0 13.4G  0 lvm   
  │ └─luks-cf19e4ac-3f54-450b-b801-72e539a8f870 253:2    0 13.4G  0 crypt /
  └─rhel_bootp--73--75--123-swap                253:1    0  1.6G  0 lvm   [SWAP]
sr0     
                     
2. Open the disk image with "guestfish --inspector"
# guestfish --ro -a disk.img --inspector --key "/dev/mapper/rhel_bootp--73--75--123-root":key:redhat123

* Actual results:
guestfish asks for the passphrase in spite of the --key option:

Enter key or passphrase ("/dev/rhel_bootp-73-75-123/root"): 

* Expected results:
"guestfish -i" should understand that "/dev/mapper/rhel_bootp--73--75--123-root" is the same as "/dev/rhel_bootp-73-75-123/root", and show the guestfish prompt without asking for a password

* Additional info:
fixed upstream by commit range 692802bf96e0..32408a9c3616

Comment 10 YongkuiGuo 2023-05-25 09:48:40 UTC
 (In reply to Laszlo Ersek from comment #1)
> Scratch build in progress:
> 
> -
> https://gitlab.cee.redhat.com/lersek/libguestfs-pkg/-/tree/devmapper-rhel9-
> 2209279 (@ d5d03ce5)
> - https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=52829845
> 
Hi lersek,
This scratch build works well as expected.

Steps:

On rhel9.3 host:
1. Prepare a guest 'rhel9-luks-on-lv.qcow2' with LUKS-on-LVM scheme
[root@localhost ~]# lsblk
NAME                                            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sr0                                              11:0    1 1024M  0 rom   
vda                                             252:0    0   10G  0 disk  
├─vda1                                          252:1    0    1G  0 part  /boot
└─vda2                                          252:2    0    9G  0 part  
  ├─rhel-root                                   253:0    0    8G  0 lvm   
  │ └─luks-e5b1101d-815d-4f07-a19e-8f739bcc3657 253:3    0    8G  0 crypt /
  └─rhel-swap                                   253:1    0    1G  0 lvm   
    └─luks-91fdf893-fff9-40b1-be55-ddb872501e72 253:2    0 1008M  0 crypt [SWAP]

2.
# guestfish --ro -a rhel9-luks-on-lv.qcow2 --inspector --key "/dev/mapper/rhel-root":key:redhat --key "/dev/mapper/rhel-swap":key:redhat

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: ‘help’ for help on commands
      ‘man’ to read the manual
      ‘quit’ to quit the shell

Operating system: Red Hat Enterprise Linux 9.1 Beta (Plow)
/dev/mapper/luks-e5b1101d-815d-4f07-a19e-8f739bcc3657 mounted on /
/dev/sda1 mounted on /boot

><fs>

Comment 11 Laszlo Ersek 2023-05-25 12:35:27 UTC
Thanks for checking! My local test succeeded as well.

Comment 35 Laszlo Ersek 2023-06-08 13:09:59 UTC
Commit range on the "rhel-9.3" branch in the upstream repo: 73061a7feafc..15cc20d1f5e0.

Comment 36 YongkuiGuo 2023-06-13 03:31:28 UTC
Verified this bug with the package:
libguestfs-1.50.1-6.el9.x86_64

Steps:

On rhel9.3 host:
1. Prepare a guest image 'rhel9.3-luks-on-lvm.qcow2'
[root@localhost ~]# lsblk
NAME                                            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
vda                                             252:0    0   10G  0 disk  
├─vda1                                          252:1    0    1G  0 part  /boot
└─vda2                                          252:2    0    9G  0 part  
  ├─vg----rhel-lv----root                       253:0    0    8G  0 lvm   
  │ └─luks-c45ece75-54d6-4d39-a11a-dcda168f61fd 253:3    0    8G  0 crypt /
  └─vg----rhel-lv----swap                       253:1    0    1G  0 lvm   
    └─luks-d3d68e46-87a3-4e59-9f5d-67495eb2d623 253:2    0 1008M  0 crypt [SWAP]

2.
# guestfish --ro -a rhel9.3-luks-on-lvm.qcow2 -i --key "/dev/mapper/vg----rhel-lv----root":key:redhat --key "/dev/mapper/vg----rhel-lv----swap":key:redhat

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: ‘help’ for help on commands
      ‘man’ to read the manual
      ‘quit’ to quit the shell

Operating system: Red Hat Enterprise Linux 9.3 Beta (Plow)
/dev/mapper/luks-c45ece75-54d6-4d39-a11a-dcda168f61fd mounted on /
/dev/sda1 mounted on /boot

><fs>

Comment 38 errata-xmlrpc 2023-11-07 08:24:21 UTC
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 (libguestfs bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2023:6327


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