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.
Description of problem:
Interacting with the RHEL 8 Beta, I noticed that it appears to include this Fedora change.
https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
However, it is still possible to corrupt system packages running pip as root. Upgrading a python module that is owned by a system package installs the new version in `/usr/local/lib/python3.6/site-packages` as desired, but removes the files in `/usr/lib/python3.6/site-packages`, which corrupts the system package.
[root@el8 ~]# /usr/libexec/platform-python -c 'import setuptools; print(setuptools.version.__version__)'
39.2.0
[root@el8 ~]# rpm -V python3-setuptools | grep -c missing
0
[root@el8 ~]# pip3.6 install -U setuptools &> /dev/null
[root@el8 ~]# /usr/libexec/platform-python -c 'import setuptools; print(setuptools.version.__version__)'
40.6.2
[root@el8 ~]# rpm -V python3-setuptools | grep -c missing
182
This same behavior can be observed in Fedora 28.
[root@f28 ~]# python3 -c 'import setuptools; print(setuptools.version.__version__)'
39.2.0
[root@f28 ~]# rpm -V python3-setuptools | grep -c missing
0
[root@f28 ~]# pip3.6 install -U setuptools &> /dev/null
[root@f28 ~]# python3 -c 'import setuptools; print(setuptools.version.__version__)'
40.6.2
[root@f28 ~]# rpm -V python3-setuptools | grep -c missing
182
Something changed between Fedora 28 and 29, because it does the right thing now.
[root@f29 ~]# python3 -c 'import setuptools; print(setuptools.version.__version__)'
40.4.3
[root@f29 ~]# rpm -V python3-setuptools | grep -c missing
0
[root@f29 ~]# pip3.7 install -U setuptools &> /dev/null
[root@f29 ~]# python3 -c 'import setuptools; print(setuptools.version.__version__)'
40.6.2
[root@f29 ~]# rpm -V python3-setuptools | grep -c missing
0
Please track down this change from F28->F29 and backport it to EL8.
Version-Release number of selected component (if applicable):
python3-pip-9.0.3-4.el8.noarch
Steps to Reproduce:
1. pip3.6 install -U setuptools
2. rpm -V python3-setuptools
Actual results:
Corrupt system package, files missing from `/usr/lib/python3.6/site-packages`.
Expected results:
Files from system package left alone.
The change is in https://src.fedoraproject.org/rpms/python-pip/pull-request/16
I'm still unsure whether to apply it to Fedora 28 or not, as it changes pip's behavior and hence is not backwards compatible.
As for RHEL8, I'm unsure whether I can disclose any plans or information, however rest assured that we are aware of the issue.
Comment 2Petr Viktorin (pviktori)
2018-11-16 11:40:44 UTC
Also note that `sudo pip install` translates to "download stuff from the Internet and run it on my machine, as root".
We can be better at limiting the damage (and, with no promises, it might be one of the things to look into after Beta). But the baseline assumption here needs to be that `sudo pip` *will* break your system. It's not something Red Hat can fully support.
Please use venv if you can.
(See "Third-party packages" in https://developers.redhat.com/blog/2018/11/14/python-in-rhel-8/ )
I know that. I'm not requesting this for myself. I'm asking because in the real world people do this. It breaks systems and eventually ends up wasting the time of people that know better who get called on to fix it.
If RHEL8 is going to include the "Making sudo pip safe" change, it might as well be the complete solution, not just a partial solution that leads people into a false sense of safety.