Bug 1303283

Summary: Update produces .rpmnew file
Product: [Fedora] Fedora Reporter: Dan Mossor [danofsatx] <danofsatx>
Component: java-1.8.0-openjdkAssignee: jiri vanek <jvanek>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: high    
Version: 23CC: ahughes, dbhole, jerboaa, jvanek, mrsam, msrb, omajid, samuel.rakitnican
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 18:18:30 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:

Description Dan Mossor [danofsatx] 2016-01-30 06:13:43 UTC
On a fresh install of Fedora 23, the very first update to the system brings in java-1.8.0-openjdk-headless.x86_64 1:1.8.0.71-1.b15.fc23. The installation of this produces this error:

warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-1.b15.fc23.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-1.b15.fc23.x86_64/jre/lib/security/java.security.rpmnew

Average users will never see this error, as this is not reported in the graphical update utilities. I would argue that this is a security vulnerability - the file in question is a java security policy (as I understand it), and it is not being applied which leaves the users potentially vulnerable to any risks mitigated by this policy.

This is on a freshly installed F23 system, on which no modifications have been made. The very first update on the system should not produce *any* .rpmnew files, the least of which a java security file. This file is not written to in the normal operation of the system, so it should not even produce the .rpmnew file in the first place.

I do not know if this is a bug against the packaging of java-1.8.0-openjdk-headless.x86_64 1:1.8.0.71-1.b15.fc23, or if dnf can't process this transaction correctly.

Comment 1 Andrew John Hughes 2016-01-30 07:45:41 UTC
The right file is copied over; check the contents of the java.security files after install.

# The pretrans lua scriptlet prevents an unmodifiedk ava.security                                                              
# from being replaced via an update. It gets created as                                                                        
# java.security.rpmnew instead. This invalidates the patch of                                                                  
# JDK-8061210 of the January 2015 CPU, JDK-8043201 of the                                                                      
# July 2015 CPU and JDK-8141287 of the January 2016 CPU. We                                                                    
# fix this via a post scriptlet which runs on updates.                                                                         
if [ "$1" -gt 1 ]; then
  javasecurity="%{_jvmdir}/%{uniquesuffix}/jre/lib/security/java.security"
  sum=$(md5sum "${javasecurity}" | cut -d' ' -f1)
  # This is the md5sum of an unmodified java.security file                                                                     
  if [ "${sum}" = '1690ac33955594f71dc952c9e83fd396' -o \\
       "${sum}" = 'b138695d0c0ea947e64a21a627d973ba' -o \\
       "${sum}" = 'd17958676bdb9f9d941c8a59655311fb' -o \\
       "${sum}" = '5463aef7dbf0bbcfe79e0336a7f92701' -o \\
       "${sum}" = '400cc64d4dd31f36dc0cc2c701d603db' -o \\
       "${sum}" = '321342219bb130d238ff144b9e5dbfc1' ]; then
    if [ -f "${javasecurity}.rpmnew" ]; then
      mv -f "${javasecurity}.rpmnew" "${javasecurity}"
    fi
  fi
fi

I believe there's already a bug to fix this properly, but I can't see it. Assigning to Jiri to look at it.

Comment 2 jiri vanek 2016-02-04 08:43:15 UTC
Yes the bug is
https://bugzilla.redhat.com/show_bug.cgi?id=1183793

I time stmaped the java.security today. Maybe it will magicaly fix the issue as it did for repcked policies. But I doubt, and generally I dont know simple way out.

*** This bug has been marked as a duplicate of bug 1183793 ***

Comment 3 Dan Mossor [danofsatx] 2016-02-08 18:54:11 UTC
I can't see that bug as it is restricted to internal Red Hat users. Can you keep this bug open for Fedora until it is corrected and tested?

Comment 4 jiri vanek 2016-02-09 07:38:33 UTC
Well, yes. Problem is, that I don know solution for now. Every solution which crossed my mind is close to be unmaintainable (as current md5sum list...). So this bug may be lingering open around for pretty long time. Sorry for inconvenience.

Comment 5 Sam Varshavchik 2016-06-26 14:58:20 UTC
This bug is getting slightly out of hand. On a machine that was upgraded, over time, from F22 to F24:

[root@monster ~]# ls /usr/lib/jvm/*/jre/lib/security/java.security.rpm*
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc22.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc22.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-13.b17.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-13.b17.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-15.b17.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-15.b17.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.fc22.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.fc22.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-4.b17.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-4.b17.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-1.b15.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-1.b15.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-4.b15.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-4.b15.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-9.b16.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-9.b16.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.77-1.b03.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.77-1.b03.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-2.b14.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-2.b14.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-5.b14.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-5.b14.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-6.b14.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-6.b14.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-1.b14.fc23.x86_64/jre/lib/security/java.security.rpmnew
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-1.b14.fc23.x86_64/jre/lib/security/java.security.rpmsave
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-1.b14.fc24.x86_64/jre/lib/security/java.security.rpmnew

Comment 6 jiri vanek 2016-06-27 09:16:49 UTC
Hello. My apologise. I'm aware of this misbehaviour (it happens only under some circumstances [actually in deep past]) And I don't know the cure.
 
If you remove all old, unsused /usr/lib/jvm/java-1.8.0-openjdk* (all except latest) AND inside the latest one remove any rpmnew/rpmsave/rpmwhatever files, you will never see this again.

Comment 7 Fedora End Of Life 2016-11-24 15:17:01 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 srakitnican 2016-12-14 13:55:19 UTC
(In reply to jiri vanek from comment #6)
> Hello. My apologise. I'm aware of this misbehaviour (it happens only under
> some circumstances [actually in deep past]) And I don't know the cure.
>  
> If you remove all old, unsused /usr/lib/jvm/java-1.8.0-openjdk* (all except
> latest) AND inside the latest one remove any rpmnew/rpmsave/rpmwhatever
> files, you will never see this again.

I tried to do that and it happened again recently:

Scriptlet output:
   1 warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-3.b16.fc25.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-3.b16.fc25.x86_64/jre/lib/security/java.security.rpmnew

Comment 9 srakitnican 2016-12-14 14:02:56 UTC
These messages occur on dnf transaction, here is the most recent one:

Scriptlet output:
   1 warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-4.b16.fc25.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-4.b16.fc25.x86_64/jre/lib/security/java.security.rpmnew

But directories does not contain rpmnew or rpmsave, so not sure why this message occurred. I don't remember removing these manually.

$ ls /usr/lib/jvm/*/jre/lib/security/java.security*
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-4.b16.fc25.x86_64/jre/lib/security/java.security

Comment 10 Fedora End Of Life 2016-12-20 18:18:30 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.