0
Answered

What does the "Use config file" option do in Desktop (Java) version?

Brandon 3 years ago • updated by Maarten Billemont 3 years ago 15
Under review
Hit the question mark next to it. ;-)

It loads your username and master password from a config file.  For now, you will need to create this config file yourself.  It is the file called ".mpw" in your user's home directory.  Make sure it is only readable by you and contains a line:

Your Name:yourmasterpassword

Alternatively, if you don't want to save this information on your disk, just enter it when prompted and leave Use config file off.
Thanks! However, there was no question mark beside that option. After I created the config file and launched the app, the question mark showed up.
Great.  The question mark will only be visible when you're in config-file mode (ie. the box is checked).
Ok. But if I don't have the config file in the home directory, then launch the app and check the "Use config file" option, the app freezes and the question mark does not appear.
Thanks!  I'll have to fix that.
same pb for me

Linux Opensuse 13.1 x86_64

i installed the cli version
then
in ~/bin/ i have a link "mpw"
in ~/share/masterpassword/ i have "baslib" , "mpw" , masterpassword-cli-GIT-SNAPSHOT.jar

i want to have same installation for the jar version
then
in ~/share/masterpassword/ i put "masterpassword-gui.jar"
in ~/bin/ i created a link masterpassword-gui.jar -> ~/share/masterpassword/masterpassword-gui.jar"


in the file ~/share/masterpassword/mpw i uncommented and completed the statement "Your Name:yourmasterpassword"

no pb with the cli version

with the jar version launched with "java -jar ~/bin/masterpassword-gui.jar"
if i check "use config file" then the app freezes
if i don't check "use config file" and fill the template then when i click on "sign in" the app disappears
1 case of "check "use config file"
@linux-b4lz:~> java -jar ~/bin/masterpassword-gui.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.DefaultComboBoxModel.<init>(DefaultComboBoxModel.java:58)
at com.lyndir.lhunath.masterpassword.ConfigAuthenticationPanel.<init>(ConfigAuthenticationPanel.java:31)
at com.lyndir.lhunath.masterpassword.UnlockFrame.createAuthenticationPanel(UnlockFrame.java:69)
at com.lyndir.lhunath.masterpassword.UnlockFrame.access$100(UnlockFrame.java:15)
at com.lyndir.lhunath.masterpassword.UnlockFrame$2$1.run(UnlockFrame.java:86)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

2. case "don't check "use config file"

@linux-b4lz:~> java -jar ~/bin/masterpassword-gui.jar
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f18e6080100, pid=15214, tid=139744521242368
#
# JRE version: OpenJDK Runtime Environment (7.0_51) (build 1.7.0_51-b00)
# Java VM: OpenJDK 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x90100] __memcpy_sse2_unaligned+0x1e0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/jvm-15214/hs_error.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abandon
@linux-b4lz:~>
i made an error : the file mpw is for the cli version and the file .mpw is for the java version
i created .mpw with the statement : "<first name> <space> <second name> : <masterpassword>"
or "<first name> <space> <second name> :" because i don't want to record the masterpassword
then
same pb : freeze when checking "use config file"
now i use by default sun java 1.7 instead of openjdk (icedtea) 1.7
there is no more pb in case of "don't check "use config file"" .
i can get a password
but
in case of "check "use config file"" it still freezes

see the messages :

@linux-b4lz:~> java -jar ~/bin/masterpassword-gui.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.DefaultComboBoxModel.<init>(Unknown Source)
at com.lyndir.lhunath.masterpassword.ConfigAuthenticationPanel.<init>(ConfigAuthenticationPanel.java:31)
at com.lyndir.lhunath.masterpassword.UnlockFrame.createAuthenticationPanel(UnlockFrame.java:69)
at com.lyndir.lhunath.masterpassword.UnlockFrame.access$100(UnlockFrame.java:15)
at com.lyndir.lhunath.masterpassword.UnlockFrame$2$1.run(UnlockFrame.java:86)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
if i put .mpw in home folder no pb i can get a password

it's not clean to have an app config file in user's home
i tried the statement <first name><space><second name>:
the app does not ask for me the master password and "sign in" stays grey

it is not secure to record the masterpassword
Note that the Java CLI version currently does not use the config file, just the C CLI version.

I will fix the exceptions related to config file usage.  Note that config file usage was not designed to record user names without master passwords.  The config file was used to store the master password.

I'll agree to a certain extent that storing the master password likely isn't the safest thing to do.  Either way, make sure to make the file only readable by you.  Note that the master password is stored plain-text (there's not much point to encrypting it in any way, any encryption would either require a password, defeating the purpose, or it would be trivial to decrypt).  Platform-specific solutions such as the Mac key chain might be an option but I'm not going to go there now.  People are welcome to contribute patches to this effect.
The latest Java GUI will not crash anymore with bad config files and will show a master password field when the config file's user has no master password set.