Bug 857717

Summary: /etc/.java/.systemPrefs directory missing breaks Banco do Brasil online banking
Product: [Fedora] Fedora Reporter: Cesar Eduardo Barros <cesarb>
Component: java-1.7.0-openjdkAssignee: Omair Majid <omajid>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: ahughes, dbhole, jvanek, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: java-1.7.0-openjdk-1.7.0.19-2.3.9.8.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-10 03:23:33 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:

Description Cesar Eduardo Barros 2012-09-16 13:51:03 UTC
Description of problem:

This is the same problem as bug 741821, but this time with openjdk 1.7. Also, two extra files should be created to avoid warnings.

The Banco do Brasil (http://www.bb.com.br/) online banking depends on a Java "security module" (módulo de segurança), which runs as an applet within the browser. This "security module" fails to load unless an /etc/.java/.systemPrefs directory is created.

Apparently, it is the preferences code within the Java runtime library that breaks if this directory does not exist. Creating this directory (nothing more than a simple "sudo mkdir -p /etc/.java/.systemPrefs") is enough to fix the problem.

To prevent this hard-to-diagnose problem on an important use case, this directory should be created by default.

Creating an empty directory works, but causes some warnings. This time, I ran a simple test program as root after creating the empty directory, which created the two empty files which need to exist to prevent the warnings. The empty files are:

/etc/.java/.systemPrefs/.systemRootModFile
/etc/.java/.systemPrefs/.system.lock


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

java-1.7.0-openjdk-1.7.0.6-2.3.1.fc17.2.x86_64

How reproducible:

Every time.

Steps to Reproduce:

See bug 741821.
  
Actual results:

See bug 741821.

Expected results:

See bug 741821.

Additional info:

After creating the empty directory by hand (sudo mkdir -p /etc/.java/.systemPrefs), I ran the following test program as root:

import java.util.prefs.Preferences;

class SystemPreferences {
	public static void main(String[] args) {
		Preferences prefs = Preferences.systemRoot();
	}
}

This creates two extra empty hidden files in the hidden directory, which prevents warnings (run it as a normal user before creating the empty hidden files to see the warnings). Thus, to make it work perfectly (without any warnings), the following directories and files need to be created:

drwxr-xr-x. 3 root root 4096 Set 16 10:27 /etc/.java
drwxr-xr-x. 2 root root 4096 Set 16 10:28 /etc/.java/.systemPrefs
-rw-r--r--. 1 root root    0 Set 16 10:28 /etc/.java/.systemPrefs/.system.lock
-rw-r--r--. 1 root root    0 Set 16 10:28 /etc/.java/.systemPrefs/.systemRootModFile

The same should apply to java-1.6.0-openjdk.

I noticed during a strace that it might be able to use the .systemPrefs from /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.6.x86_64/jre/.systemPrefs instead. I did not investigate further; if it works, this might be an alternative to creating /etc/.java/.systemPrefs.

Comment 1 Cesar Eduardo Barros 2012-09-16 13:56:07 UTC
Found more information:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4751177

"System prefs are normally rooted at /etc/.java/.systemPrefs in a "local install", or <java.home>/.systemPrefs in a "network install.""

It seems the correct option is to use /etc/.java/.systemPrefs, so the sysadmin can change them if needed.

Comment 2 Fedora Update System 2013-06-08 07:56:52 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19

Comment 3 Fedora Update System 2013-06-08 07:57:07 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.8.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/java-1.7.0-openjdk-1.7.0.19-2.3.9.8.fc18

Comment 4 Fedora Update System 2013-06-08 07:57:18 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.6.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/java-1.7.0-openjdk-1.7.0.19-2.3.9.6.fc17

Comment 5 Fedora Update System 2013-06-08 18:05:54 UTC
Package java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10379/java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-06-10 03:23:33 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2013-06-11 08:57:31 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.6.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-06-11 09:01:31 UTC
java-1.7.0-openjdk-1.7.0.19-2.3.9.8.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.