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

            Bug ID: 1947703
           Summary: Fix broken call to perl.prov when filenames contain
                    spaces
           Product: Fedora
           Version: 33
            Status: NEW
         Component: perl-generators
          Assignee: jples...@redhat.com
          Reporter: b...@debian.org
        QA Contact: extras...@fedoraproject.org
                CC: jples...@redhat.com,
                    perl-devel@lists.fedoraproject.org, ppi...@redhat.com
  Target Milestone: ---
    Classification: Fedora



Created attachment 1770474
  --> https://bugzilla.redhat.com/attachment.cgi?id=1770474&action=edit
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.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/perl-devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to