On 03/14/2013 11:18 PM, Robin H. Johnson wrote:
> On Thu, Mar 14, 2013 at 10:32:30PM -0400, Michael Mol wrote:
>>> As to how to accomplish this, it's either a throwaway sig, or poking the
>>> agent protocol directly.
>> The only trouble with that is if the agent is configured to only unlock
>> keys for limited periods of time, then your initial check might catch
>> the agent when the key is still unlocked, but your subsequent call to
>> GPG comes after the timeout. I ran into this while trying to set up
>> automated signing of debian packages I was building.
> So Debian has a test-gpg function already? Do you know where in their
> codebase it is?

No idea; a build system I'd cobbled together at the time prodded
gpg-agent to get an interactive auth. The build-and-package step took
too long, leading to the timeout. And I apologize; I don't remember
exactly what I was doing to prod gpg-agent, and since it was for a prior
job, I did not retain any copies of any of the materials.

> 
>> All it really means, in a practical procedural sense, is that you need
>> to allow yourself a way to roll back anything you've been doing if that
>> later check fails.
> I think we'd do:
> - All repoman checks
> - initial file editing
> if two-phase commit:
> - test gpg
> - commit1
> - gpg sign
> - commit2
> if one-phase commit:
> - gpg test
> - gpg sign
> - commit1
> 
> Unless commit1 took a really long time, the interval between the gpg
> calls should be very small.
> 

Murphy's going to call in a long I/O hang somewhere. Race conditions are
hell manifest in systems.

Since I haven't been paying close attention to this thread, I'm missing
some context, but if you're commit1 and commit2 apply to a DVCS, you're
probably fine so long as you don't do a push between commit1 and
commit2, don't do a push if any earlier step failed, and do all this in
a temporary branch that never (as a branch) gets pushed upstream.

If you're not applying to a DVCS, then you risk interleaving commit1 and
commit2 with others' work anyway.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to