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 2089748 - Removal of "--selinux-relabel" option breaks existing scripts
Summary: Removal of "--selinux-relabel" option breaks existing scripts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: guestfs-tools
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On:
Blocks: 2075718
TreeView+ depends on / blocked
 
Reported: 2022-05-24 11:09 UTC by Cédric Jeanneret
Modified: 2022-11-15 10:13 UTC (History)
9 users (show)

Fixed In Version: guestfs-tools-1.48.2-4.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 09:52:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-123160 0 None None None 2022-05-24 11:16:00 UTC
Red Hat Product Errata RHSA-2022:7959 0 None None None 2022-11-15 09:52:57 UTC

Description Cédric Jeanneret 2022-05-24 11:09:04 UTC
Description of problem:
It appears the removal of "--selinux-relabel" option was pushed in the 1.48.1 version, which is distributed in CentOS Stream 9.

While I'm completely OK with "default on relabel things", it breaks existing scripts that were calling on purpose the --selinux-relabel parameter:

virt-sysprep: unrecognized option '--selinux-relabel'


Version-Release number of selected component (if applicable):
guestfs-tools-1.48.1-1.el9.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Get a CentOS Stream 9 host, ensure all is up-to-date
2. install latest guestfs-tools
3. run any command with "--selinux-relabel", for instance: virt-sysprep -a {IMAGE} --selinux-relabel [... some other options] 

Actual results:
It fails due to a now unknown option

Expected results:
It should still succeed, but probably output a warning about the deprecation of that option

Additional info:
Apparently the patch is this one: https://github.com/libguestfs/libguestfs/commit/2f6a27f1077d32d1ab526427052fc88e188356f7
I started a discussion there, resulting in this BZ creation


Also: it will affect OSP CI, being upstream and downstream, and may lead to some major issues in our delivery processes... Hopefully I caught it early.

Comment 1 Richard W.M. Jones 2022-05-24 12:19:26 UTC
I confirmed this here too, commands such as "virt-builder fedora-36 --selinux-relabel"
fail with an unknown option.  See also the upstream series:

https://listman.redhat.com/archives/libguestfs/2022-May/thread.html#28826

and original bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1554735
https://bugzilla.redhat.com/show_bug.cgi?id=2075718

Comment 2 Laszlo Ersek 2022-05-25 07:20:58 UTC
[libguestfs PATCH] generator/customize: reintroduce "--selinux-relabel" as a compat option
Message-Id: <20220525071958.9612-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-May/028972.html

[libguestfs-common PATCH] mlcustomize: refresh generated files
Message-Id: <20220525072008.9689-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-May/028973.html

Comment 3 Laszlo Ersek 2022-05-25 11:07:31 UTC
(In reply to Laszlo Ersek from comment #2)
> [libguestfs PATCH] generator/customize: reintroduce "--selinux-relabel" as a compat option
> Message-Id: <20220525071958.9612-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-May/028972.html

commit range 63b722b6c094..9e69a38d8234

> [libguestfs-common PATCH] mlcustomize: refresh generated files
> Message-Id: <20220525072008.9689-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-May/028973.html

commit f8de5508fe75

guestfs-tools: commit 273de755dfe7 ("update common submodule", 2022-05-25)

Comment 6 YongkuiGuo 2022-05-27 02:51:16 UTC
Verified with guestfs-tools-1.48.2-1.el9.x86_64


Steps:

1. On rhel9.1 host
$ virt-builder fedora-36 --selinux-relabel
[   9.1] Downloading: http://builder.libguestfs.org/fedora-36.xz
###################################################################################################################### 100.0%###################################################################################################################### 100.0%
[  96.5] Planning how to build this image
[  96.5] Uncompressing
[  98.8] Opening the new disk
[ 107.6] Setting a random seed
[ 107.6] Setting passwords
virt-builder: Setting random password of root to QVWvz00xHSTuWIX8
[ 109.0] SELinux relabelling
[ 121.1] Finishing off
                   Output file: fedora-36.img
                   Output size: 6.0G
                 Output format: raw
            Total usable space: 6.0G
                    Free space: 4.7G (79%)

No error like this "virt-builder: unrecognized option '--selinux-relabel'".

Comment 7 Cédric Jeanneret 2022-05-30 07:01:49 UTC
Thank you!

Comment 9 errata-xmlrpc 2022-11-15 09:52:44 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 (Low: guestfs-tools security, 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/RHSA-2022:7959


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