From dd446094737ec8274f8c5c3d59ab1466e2ebacc0 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 11 Oct 2012 03:56:46 +0900 Subject: make file_path explicit --- src/leap/crypto/leapkeyring.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/leap/crypto/leapkeyring.py b/src/leap/crypto/leapkeyring.py index bb0ca147..bceadc75 100644 --- a/src/leap/crypto/leapkeyring.py +++ b/src/leap/crypto/leapkeyring.py @@ -1,7 +1,7 @@ -import os - import keyring +from leap.base.config import get_config_file + ############# # Disclaimer ############# @@ -20,7 +20,11 @@ import keyring class LeapCryptedFileKeyring(keyring.backend.CryptedFileKeyring): - filename = os.path.expanduser("~/.config/leap/.secrets") + filename = ".secrets" + + @property + def file_path(self): + return get_config_file(self.filename) def __init__(self, seed=None): self.seed = seed -- cgit v1.2.3 From 661215788752bb7b06e8ba16ac53051a67a451b3 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 11 Oct 2012 04:36:01 +0900 Subject: another attempt at fixing recursion error with expanduser --- src/leap/base/config.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 57f9f1b7..776c0a49 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -220,10 +220,26 @@ def get_config_dir(): # check for $XDG_CONFIG_HOME var? # get a more sensible path for win/mac # kclair: opinion? ^^ - return os.path.expanduser( - os.path.join('~', - '.config', - 'leap')) + + # XXX DEBUG for #744 + #logger.debug('expanduser? --- %s', os.path.expanduser('~')) + logger.debug('$HOME? --- %s', os.environ.get('HOME', None)) + logger.debug('user? --- %s', os.getlogin()) + + try: + return os.path.expanduser( + os.path.join('~', + '.config', + 'leap')) + except RuntimeError: + # We're getting a recursion error + # that I suspect is caused by some bug on + # expanduser... + return os.path.join( + 'home', + '%s' % os.getlogin(), + '.config', + 'leap') def get_config_file(filename, folder=None): -- cgit v1.2.3 From 272d72506d667ae4dc8719066422f782983e6746 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 11 Oct 2012 04:53:22 +0900 Subject: removed debug info since eval HOME is causing the bug --- src/leap/base/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 776c0a49..642470e6 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -223,8 +223,8 @@ def get_config_dir(): # XXX DEBUG for #744 #logger.debug('expanduser? --- %s', os.path.expanduser('~')) - logger.debug('$HOME? --- %s', os.environ.get('HOME', None)) - logger.debug('user? --- %s', os.getlogin()) + #logger.debug('$HOME? --- %s', os.environ.get('HOME', None)) + #logger.debug('user? --- %s', os.getlogin()) try: return os.path.expanduser( -- cgit v1.2.3 From a964b9e55a53b1d87d296e0f3b5295b0366c5967 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 11 Oct 2012 07:22:49 +0900 Subject: comment out the set_password call until we fix #744 --- src/leap/base/config.py | 23 ++++------------------- src/leap/gui/firstrunwizard.py | 7 +++++-- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 642470e6..cf01d1aa 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -221,25 +221,10 @@ def get_config_dir(): # get a more sensible path for win/mac # kclair: opinion? ^^ - # XXX DEBUG for #744 - #logger.debug('expanduser? --- %s', os.path.expanduser('~')) - #logger.debug('$HOME? --- %s', os.environ.get('HOME', None)) - #logger.debug('user? --- %s', os.getlogin()) - - try: - return os.path.expanduser( - os.path.join('~', - '.config', - 'leap')) - except RuntimeError: - # We're getting a recursion error - # that I suspect is caused by some bug on - # expanduser... - return os.path.join( - 'home', - '%s' % os.getlogin(), - '.config', - 'leap') + return os.path.expanduser( + os.path.join('~', + '.config', + 'leap')) def get_config_file(filename, folder=None): diff --git a/src/leap/gui/firstrunwizard.py b/src/leap/gui/firstrunwizard.py index 6f2c83ce..a76865fd 100755 --- a/src/leap/gui/firstrunwizard.py +++ b/src/leap/gui/firstrunwizard.py @@ -167,7 +167,7 @@ class FirstRunWizard(QtGui.QWizard): """ provider = self.get_provider() username = self.field('userName') - password = self.field('userPassword') + #password = self.field('userPassword') remember_pass = self.field('rememberPassword') logger.debug('chosen provider: %s', provider) @@ -185,7 +185,10 @@ class FirstRunWizard(QtGui.QWizard): seed = self.get_random_str(10) settings.setValue("%s_seed" % provider, seed) - leapkeyring.leap_set_password(username, password, seed=seed) + # Commenting out for 0.2.0 release + # since we did not fix #744 on time. + + #leapkeyring.leap_set_password(username, password, seed=seed) logger.debug('First Run Wizard Done.') cb = self.success_cb -- cgit v1.2.3