Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix keyring - name collision bug #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prydom
Copy link

@prydom prydom commented Oct 3, 2014

See 97380da for details on fix for #15.

I also changed the package to use the newest available keyring package. The currently available one works fine but you may want to freeze it there instead of using >=. I will leave that up to you.

prydom added 2 commits October 2, 2014 22:21
When a Quest ID is the same as the system username the Quest password
concatenated with the username was treated as the default user. The
mitigation for this was to prefix the current username with "_config_"
and treat that as the username to store the user comma separated list.
To make things more clear the variable name 'current' was changed to
'key_to_users_csv'.

This fix was manually tested. It does not seem like this project has
unit tests although a harness exists.
@hkpeprah
Copy link
Owner

Sorry about the late handle on this. Reviewing it now.

@@ -104,8 +106,8 @@ def remove_user(username):
raise NoUserException("Error: expected a username, given None.")
if not user_exists(username):
raise NoUserException("Error: %s is not a valid user."% username)
current = getpass.getuser()
users = keyring.get_password(PROG, current)
key_to_users_csv = getpass.getuser()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key_to_users_csv = CONFIG_PREFIX + getpass.getuser()

@hkpeprah
Copy link
Owner

Might be good to just make a helper function instead of add the prefix in every instance, makes it easier to modify if anything.

def getuser():
    return CONFIG_PREFIX + getpass.getuser()

or something similar

@hkpeprah
Copy link
Owner

Read keyring's CHANGELOG from 4.0 to 3.3, things seem fine on that end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants