Bug 1259309

Summary: Broken .bashrc if rebuilt as root
Product: Red Hat Enterprise Linux 7 Reporter: Lukáš Zachar <lzachar>
Component: abrt-java-connectorAssignee: abrt <abrt-devel-list>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: low Docs Contact:
Priority: low    
Version: 7.1CC: azelinka, isenfeld, mhabrnal
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: abrt-java-connector-1.0.6-12.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 18:15:18 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:
Attachments:
Description Flags
Patch 1/2: Clearly state that tests cannot be run under root
none
Patch 2/2: Update tests for rhel-7.4 none

Description Lukáš Zachar 2015-09-02 11:55:06 UTC
Description of problem:

When abrt-java-connector is rebuilt as root, one of the tests run during %check phase causes /root/.bashrc to be overwritten with '*'.

Version-Release number of selected component (if applicable):
abrt-java-connector-1.0.6-6.el7

How reproducible:
always

Steps to Reproduce:
1. rpmbuild --rebuild abrt-java-connector... as root
2. cat /root/.bashrc


Actual results:
modified /root/.bashrc (contains '*')

Expected results:
old file is kept

Additional info:
File test/Test.java contains:
...
* Attempt to write into a file which is not writable for given user.
...
File f = new File("/root/.bashrc");
try {
   FileOutputStream fos = new FileOutputStream(f);
   try {
      fos.write(42);

Comment 5 Matej Habrnal 2017-01-26 12:58:13 UTC
Opened upstream pull request https://github.com/jfilak/abrt-java-connector/pull/46

Comment 6 Matej Habrnal 2017-02-14 12:10:18 UTC
Created attachment 1250195 [details]
Patch 1/2: Clearly state that tests cannot be run under root

Comment 7 Matej Habrnal 2017-02-14 12:10:21 UTC
Created attachment 1250196 [details]
Patch 2/2: Update tests for rhel-7.4

Comment 12 errata-xmlrpc 2017-08-01 18:15:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1927