Re: [PATCH] t/gpg: simplify test for unknown key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 11, 2022 at 06:26:21PM +0100, Fabian Stelzer wrote:
> > I was about to submit
> > exactly this patch for you but with:
> >
> > 	-       test_must_fail git verify-commit thirteenth-signed 2>actual &&
> > 	+       test_must_fail env GNUPGHOME="$GNUPGHOME_NOT_USED" git verify-commit initial 2>actual &&
> >
> > Both of those are probably a good thing to do here. I.e.:
> >
> > 1. Didn't we have portability issues with "ENV_VAR=VALUE shell_function ..." ?
>
> I'm not good with portability stuff and trust your judgment on this.

See [1] and the ensuing discussion for a good summary. Re-reading
that thread and comparing it with what we see with `git grep
test_must_fail env -- t` confirms that that

    test_must_fail env GNUPGHOME="$GNUPGHOME_NOT_USED" git verify-commit ...

is the right thing to do here.

> > 2. You're pointing to a nonexisting ./empty_home, but shouldn't we use
> >    $GNUPGHOME_NOT_USED? The existing "show unknown signature with custom format"
> >    test in the same file does that.
>
> I was not aware of $GNUPGHOME_NOT_USED but it is used in a similar fashion.
> However it is set to the old value of $GNUPGHOME before we change it in
> lib-gpg.sh which seems wrong to me. Wouldn't it then just pick up the gpg
> homedir of whatever the test environment has?
> Using the variable is good, but i would set it to a known empty directory
> or?

Yeah, t7510 captures the value of $GNUPGHOME as $GNUPGHOME_NOT_USED
before sourcing t/lib-gpg.sh. So long as nobody else has tampered with
$GNUPGHOME, they should get `$TRASH_DIRECTORY/gnupg-home-not-used`.

But I'm less certain that there isn't somebody accidentally ignoring the
"not-used" portion of the test $GNUPGHOME ;).

And I don't think that reasoning through it all is that worthwhile, so
I'm fine with what a much more direct ./empty_home here.

Thanks,
Taylor

[1]: https://lore.kernel.org/git/xmqqbn3l3kmc.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux