m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Welch <von@vwelch.com>2013-02-11 22:08:30 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2013-02-23 13:33:02 +0100
commit5afc207d28f290936dca8fcdcab3157d3056379a (patch)
tree2702c749449bc9f90362fa4956dc5b1439ce01ad
parent7ff656179de5ab3b526dbf5a372ecdfcb0d7fab6 (diff)
keepassx2pass.py should handle empty passwords and entry names containing slash ('/') characters
-rwxr-xr-xcontrib/keepassx2pass.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/keepassx2pass.py b/contrib/keepassx2pass.py
index 6043690..1804e33 100755
--- a/contrib/keepassx2pass.py
+++ b/contrib/keepassx2pass.py
@@ -11,13 +11,14 @@ from xml.etree import ElementTree
def path_for(element, path=''):
""" Generate path name from elements title and current path """
- title = element.find('title').text
+ title = element.find('title').text.replace("/", "|")
return '/'.join([path, title])
def password_data(element):
""" Return password data and additional info if available from
password entry element. """
- ret = element.find('password').text + "\n"
+ passwd = element.find('password').text
+ ret = passwd + "\n" if passwd else "\n"
for field in ['username', 'url', 'comment']:
fel = element.find(field)
if fel.text is not None: