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.
IMO it is not a good idea to replace characters inside the template block `{{` ... `}}`.
I looked at what docker is doing and they have the same problem except for the inspect commands where no replace is done.
I would argue that we should not touch the user input at all but I guess this was done for docker compat.
A simple reproducer that should work with all --format flags is: --format '{{printf "\n"}}'
I see three solutions:
1. do not replace at all (this will break docker compat)
2. do not replace inside {{ }} blocks (could also break backwards compat)
3. replace and parse the template, if it fails parse again with the raw input without replace.
I would prefer 3 since this will not cause any regressions for user relying on the current implementation.
@jhonce WDYT?
(In reply to Paul Holzinger from comment #4)
> IMO it is not a good idea to replace characters inside the template block
> `{{` ... `}}`.
> I looked at what docker is doing and they have the same problem except for
> the inspect commands where no replace is done.
> I would argue that we should not touch the user input at all but I guess
> this was done for docker compat.
>
> A simple reproducer that should work with all --format flags is: --format
> '{{printf "\n"}}'
> I see three solutions:
> 1. do not replace at all (this will break docker compat)
> 2. do not replace inside {{ }} blocks (could also break backwards compat)
> 3. replace and parse the template, if it fails parse again with the raw
> input without replace.
>
> I would prefer 3 since this will not cause any regressions for user relying
> on the current implementation.
> @jhonce WDYT?
@pholzing #3 sounds like the best solution, we need the compat where possible.
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 (Moderate: container-tools:rhel8 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-2023:2758
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 (Moderate: container-tools:rhel8 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-2023:2758
Description of problem: join template in `podman inspect --format` does not accept new line as a separator: # podman inspect ubi8 --format '{{join .Config.Env "\n"}}' ERRO[0000] Printing inspect output: template: all inspect:1: unterminated quoted string But space/tab works: # podman inspect ubi8 --format '{{join .Config.Env "\t"}}' PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci # podman inspect ubi8 --format '{{join .Config.Env " "}}' PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci Version-Release number of selected component (if applicable): podman-4.0.0-3.module+el8.6.0+14305+6b14f34e.x86_64 How reproducible: always Steps to Reproduce: 1. podman inspect ubi8 --format '{{join .Config.Env "\n"}}' 2. 3. Actual results: ERRO[0000] Printing inspect output: template: all inspect:1: unterminated quoted string Expected results: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci Additional info: