Bug 1322792

Summary: Failure in %pretrans still installs dependencies
Product: Red Hat Enterprise Linux 6 Reporter: Assen Totin <assen>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.7CC: james.antill
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-06 12:16:09 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:
Bug Depends On:    
Bug Blocks: 1499211    

Description Assen Totin 2016-03-31 10:53:22 UTC
Description of problem:
When a %prentans script is specified in a spec file and it exits with non-zero code, the installation of the current RPM is aborted; however, if additional packages were selected as dependencies, they still get installed even though the %pretrans has failed and the main RPM does not get installed.

It is important to note that %pretrans is checked before any dependencies are installed, so a failure there should abort the whole transaction (including the dependencies).

Version-Release number of selected component (if applicable):
yum-3.4.3-153.fc21.noarch

How reproducible:
Every time.

Steps to Reproduce:
1. Create an RPM from a spec file which has a %prentans section. Add a dependency RPM package to the spec and make the %pretrans section exit with non-zero code.
2. Install the RPM package on a machine where the dependency RPM package is missing. 

Actual results:
The %preptans will fail and the main RPM package will not be installed, but the dependency package will be installed.

Expected results:
The dependency packages should not be installed if a %pretrans form the main RPM has failed. 

Additional info:
The main problem here is not so much the fact that dependencies still get installed, but the fact that the failure of %pretrans from the main RPM (hence the failure to install the main RPM) remains obscure, especially if running yum in interactive mode from console. One can well consider the main RPM installed, which leads to much confusion later about it actually missing.

Comment 2 Jan Kurik 2017-12-06 12:16:09 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/