Commit 01ad50fc authored by Mike Evans's avatar Mike Evans Committed by Colomban Wendling

Add account_name to output

parent 65efd77f
......@@ -100,12 +100,14 @@ static void accountrc_decrypt(const gchar *filename)
for (i = 0; i < n_groups; i++) {
gchar *input = g_key_file_get_value(kf, groups[i], "password", NULL);
gchar *address = g_key_file_get_value(kf, groups[i], "address", NULL);
gchar *account = g_key_file_get_value(kf, groups[i], "account_name", NULL);
gchar *output = input ? pass_decrypt(input) : NULL;
printf("password for %s is \"%s\"\n", address, output);
printf("password for %s, %s is \"%s\"\n", account, address, output);
g_free(input);
g_free(output);
g_free(address);
g_free(account);
}
g_strfreev(groups);
}
......
......@@ -70,11 +70,13 @@ def accountrc_decrypt(filename, key=PASSCRYPT_KEY):
try:
try:
address = p.get(s, 'address')
account = p.get(s, 'account_name')
except:
address = '<unknown>'
account = '<unknown>'
password = pass_decrypt(p.get(s, 'password'), key)
print('password for %s is "%s"' % (address, password))
print('password for %s, %s is "%s"' % (account, address, password))
except Exception as e:
print('Error resolving password for account "%s": %s' % (s, e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment