[pass] 'pass insert' bugs

Von Welch von at vwelch.com
Wed Apr 23 15:43:09 CEST 2014


Jason,

 I think there is a fundamental decision here which you seem to have made,
and that is pass will not auto-detect whether or not it is working with an
interactive user (e.g. is stdin a terminal or pipe?) and adjust it's
behavior. It assumes an interactive user and it's up to the test harness to
assert appropriate options or hack the environment (e.g. set
GPG_AGENT_INFO) to do what it needs to do.

 I'm just thinking we need a "Who to write a test" README that captures
things like this.

Von





On Tue, Apr 22, 2014 at 7:53 AM, Jason A. Donenfeld <Jason at zx2c4.com> wrote:

>
>
> On Mon, Apr 21, 2014 at 3:56 AM, Von Welch <von at vwelch.com> wrote:
>>
>> You fixed the interactive case, but the following now hangs if the
>> password does not exist:
>>
>> % echo "foo" | ../src/password-store.sh insert my-pass
>>
>> (It also points out a shortcoming of sharness.sh, which is it doesn't
>> support any timeouts on tests that I can see.)
>>
>
> Yes. I have it ask again if we get an EOF (or CTRL+D). It's interactive,
> remember?
>
> But to please your tests, I made this change:
>
> http://git.zx2c4.com/password-store/commit/?id=07bcfccebfa2f885849f0b8698a496c3c757d8a7
>
>
>
>>
>> ...
>>
>>> Seems to be the desired behavior, since you don't have to enter the
>>> password twice in -e mode, right?
>>
>>
>> I suggest that returning a non-zero status but not printing an error
>> message is a bug. If a user isn't explicitly checking the return status
>> (it's obvious to me because my prompt prints it), they could easily miss
>> the failure.
>>
>
> It returns 1 and exits because there's a prompt that says "override this
> file?" and your echo input is "foo", which is not "Y". Use -f in your tests
> if you'd like to avoid this. Or account for sending "y\n" if it exists.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140423/938a16dd/attachment.html>


More information about the Password-Store mailing list