News for hackers. Stuff that matters.
Re:Show HN: Passmgr – Securely store passphrases and retriev... by urld on Sunday June 18, 2017 @11:35AM (#14581080)
Good point. Im going to implement this, although its probably not possible to make it an atomic operation.
Re:Show HN: Passmgr – Securely store passphrases and retriev... by justtopostthis3 on Sunday June 18, 2017 @12:30PM (#14581411)
On X11 you can do better: the clipboard isn't actually stored anywhere, the program requesting the paste gets the data directly from the program that claimed the clipboard.

The clipboard lib you're using just spawns xclip (or xsel) on Unix. xclip has a -loops argument that is the maximum number of pastes. So you could just spawn:

  xclip -loops 1 -in -selection clipboard
And the password would be available to paste exactly once. Unfortunately I don't think xsel has any such option.

There are clipboard manager apps that could grab the paste immediately and persist it, but I'm not sure how common they are or if they are default anywhere.