diff options
Diffstat (limited to 'bin/pwsafe2pass')
-rwxr-xr-x | bin/pwsafe2pass | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/bin/pwsafe2pass b/bin/pwsafe2pass deleted file mode 100755 index fa7b634..0000000 --- a/bin/pwsafe2pass +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -# run as pwsafe --exportdb | pwsafe2pass -# requires an already initialized pass database - -# headers -readline; -readline; - -while (my $line = <>) { - chomp $line; - my ($uuid, $group, $name, $login, $passwd, $notes) = map { - s/^"(.*)"$/$1/; - - # sigh - s/\\\\/\\/g; - s/>/>/g; # not a typo, they really forgot the ; - s/</</g; - s/&/\&/g; - - $_ - } split /\t/, $line; - - # XXX pass doesn't handle filenames with spaces properly - s/\s/-/g for $group, $name; - die "pass can't handle files with spaces" if $login =~ /\s/; - - my $entry = join '/', $group, $name, length($login) ? ($login) : (); - - open my $fh, '|-', 'pass', 'insert', ($notes ? ('-m') : ('-e')), $entry - or die "Couldn't insert!"; - $fh->print("$passwd\n"); - $fh->print("$notes\n") if $notes; - $fh->close; - - # XXX pass doesn't propagate git failure exit codes to the overall process, - # so failures in 'git add' or whatever will fail silently - die "Failed to insert $entry: $?" if $?; -} |