[pass] [PATCH v2] Team pass: enable multiple keys and per directory

Josh Cartwright joshc at eso.teric.us
Thu Mar 20 02:52:03 CET 2014


On Thu, Mar 20, 2014 at 12:06:45PM +1100, Matthew Cengia wrote:
> On 2014-03-19 19:51, Josh Cartwright wrote:
> [...]
> > Also, note that command substitution ($() and ``) has the really
> > annoying feature of removing trailing newlines...but sometimes those
> > newlines are significant.  Any sane person wouldn't go putting newlines
> > in filenames, however in clipboard data this can be important.
> > Presumably this is the explanation of pass bizarrely using base64 to
> > store clipboard data?
> 
> I've not thought very hard as to why trailing newlines would be
> significant, but let's operate on the assumption that it is:
> 
> | mattcen at sonar:tmp$ x="$(printf "%s\n%s\n\n\n" foo bar; echo EOF)"
> | x=${x%EOF}; echo "$x"
> | foo
> | bar
> | 
> | 
> | 
> | mattcen at sonar:tmp$
> 
> Problem solved. Ugly, and I'd seriously question whether that's the
> right problem to solve (rather than deciding whether trailing whitespace
> is significant) before implementing it as a solution.

Yep, agreed.  It is ugly.

In the clipboard case, I think pass shouldn't be in the business of
saving/restoring data, instead it should just clear the clipboard after
a timeout.  (As was suggested in a previous thread).  Then the whole
base64 nonsense can be dropped entirely.

(Interestingly enough, the base64 encoding not only solved the trailing
 newline problem, but also the embedded NUL problem as well).

  Josh


More information about the Password-Store mailing list