Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1947703

Summary: Fix broken call to perl.prov when filenames contain spaces
Product: [Fedora] Fedora Reporter: Ben Burton <bab>
Component: perl-generatorsAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: jplesnik, perl-devel, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-generators-1.13-1.fc35 perl-generators-1.13-1.fc33 perl-generators-1.13-1.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-19 01:30:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix issue none

Description Ben Burton 2021-04-09 00:38:50 UTC
Created attachment 1770474 [details]
Patch to fix issue

Description of problem:

If %_topdir contains spaces, then RPM package builds produce errors when calculating perl dependencies.  These errors appear to be non-fatal (the RPM builds run to completion), but given the nature of the problem it does seem possible that the perl dependencies are not being deduced correctly.

The issue is simple: /usr/lib/rpm/perl.req contains a readpipe call to "$prov_script $file", which is interpreted by the shell, without properly quoting or escaping its $file argument.

I've attached a patch which fixes this, patched and tested against Fedora 33.  The patch is simple: it puts single quotes around the argument $file in the readpipe() call to stop the shell splitting the $file argument (or indeed doing other unwanted substitutions/code-calling/etc.).  Since $file might also contain single quotes, I've added a substitution regex beforehand that replaces each ' with '"'"' so that the shell picks up any single quotes correctly.

How reproducible:

Consistently reproducible; just use a topdir with spaces and then build any spec file that includes perl scripts.

Additional info:

For me at least the bug was practical, not just theoretical - I encountered this when building Fedora packages in a continuous integration system, where the RPM build directories were beneath machine-specific directories with names such as "Fedora 33", "Fedora 32", etc.

Comment 1 Fedora Update System 2021-05-10 15:42:37 UTC
FEDORA-2021-f07429afc3 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-f07429afc3

Comment 2 Fedora Update System 2021-05-10 15:42:37 UTC
FEDORA-2021-92c4c0c0eb has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-92c4c0c0eb

Comment 3 Fedora Update System 2021-05-11 01:23:21 UTC
FEDORA-2021-f07429afc3 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-f07429afc3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f07429afc3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2021-05-12 04:43:18 UTC
FEDORA-2021-92c4c0c0eb has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-92c4c0c0eb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-92c4c0c0eb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2021-05-19 01:30:28 UTC
FEDORA-2021-f07429afc3 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2021-05-20 01:09:46 UTC
FEDORA-2021-92c4c0c0eb has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.