Bug 1473331

Summary: /etc/bash_completion.d/yum-utils.bash runs pkg-config without fully qualified path
Product: Red Hat Enterprise Linux 7 Reporter: James Pearson <james-p>
Component: yum-utilsAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: mdomonko, packaging-team-maint
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-18 12:02:22 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:
Bug Depends On:    
Bug Blocks: 1630909    

Description James Pearson 2017-07-20 13:52:26 UTC
Description of problem:

The bash completion script (/etc/bash_completion.d/yum-utils.bash) installed by yum-utils does:

type -t _yum >/dev/null || . $(pkg-config --variable=completionsdir bash-complet
ion)/yum

If another 'pkg-config' is earlier on the PATH, this could cause issues - especially if running '/bin/su' from a user account that doesn't use bash as their default shell (e.g. tcsh)

Version-Release number of selected component (if applicable):

yum-utils-1.1.31-40.el7

How reproducible:

Always

Steps to Reproduce:
1. Set up user account that uses /bin/tcsh as the shell
2. Log in as the user
3. Set up path that includes a directory containing a custom pkg-config script before /usr/bin
4. Run /bin/su and type in root password

Actual results:

User 'root' runs the user's pkg-config script - which can do anything the user wants ...

Expected results:

/usr/bin/pkg-config is run

Additional info:

Ideally, root's .bashrc should set a restricted PATH - but this isn't the case with the shipped version

A simple fix is to make sure pkg-config is executed as /usr/bin/pkg-config in /etc/bash_completion.d/yum-utils.bash

Comment 3 Daniel Mach 2019-07-18 12:02:22 UTC
This bug is not planned to be addressed during Red Hat Enterprise Linux 7 life-cycle.
Please contact Red Hat support if you wish to have it reconsidered.