Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-32626

leapp crashes with "ValueError: too many values to unpack" when a 3rd party package contains a pipe in Packager field

    • Normal
    • sst_upgrades
    • False
    • Hide

      None

      Show
      None
    • Red Hat Enterprise Linux

      What were you trying to do that didn't work?

      When customers have a 3rd party package installed on the system to upgrade and the Packager field of the package contains a pipe, this leads to a crash:

      Process Process-227:
      Traceback (most recent call last):
        File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
          self.run()
        File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
          self._target(*self._args, **self._kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
          actor_instance.run(*args, **kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 289, in run
          self.process(*args)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/rpmscanner/actor.py", line 20, in process
          rpmscanner.process()
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/rpmscanner/libraries/rpmscanner.py", line 118, in process
          name, version, release, epoch, packager, arch, pgpsig = entry.split('|')
      ValueError: too many values to unpack
      

      The root cause is the rpm -qa --queryformat '...' command doesn't escape pipes, causing too many fields to be returned.

      Please provide the package NVR for which bug is seen:

      All leapp releases

      How reproducible:

      Always

      Steps to reproduce

      1. Install an evil package
        # yum install ./evil-0.0.1-1.noarch.rpm
      2. Execute preupgrade
        # leapp preupgrade

      Expected results

      No crash

      Actual results

      Crash above

            leapp-notifications leapp-notifications
            rhn-support-rmetrich Renaud Metrich
            leapp-notifications leapp-notifications
            RHEL Upgrades QE Team RHEL Upgrades QE Team
            Miriam Portman Miriam Portman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: