Skip to content

Commit

Permalink
Merge pull request #167 from olcf/ngin_distribute_fix
Browse files Browse the repository at this point in the history
allows users to distribute to a single person without overwriting
  • Loading branch information
Noah Ginsburg authored Apr 21, 2020
2 parents a09b061 + 84bb51e commit b125e7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions libpkpass/commands/distribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def _run_command_execution(self):
passphrase=self.passphrase,
card_slot=self.args['card_slot'])

password.read_password_data(dist_pass)
password.add_recipients(secret=plaintext_pw,
distributor=self.args['identity'],
recipients=self.recipient_list,
Expand Down
3 changes: 2 additions & 1 deletion libpkpass/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ def add_recipients(
if recipients is None:
recipients = []

self.recipients = {r:self._add_recipient(
new_recipients = {r:self._add_recipient(
r, secret, distributor, identitydb, encryption_algorithm, passphrase, card_slot
) for r in recipients}
self.recipients.update(new_recipients)
if escrow_users:
#escrow_users may now be none after the set operations
if (len(escrow_users) > 3) and (len(list((set(escrow_users) - set(recipients)))) < 3):
Expand Down

0 comments on commit b125e7f

Please sign in to comment.