1 |
On 03/14/2013 11:18 PM, Robin H. Johnson wrote: |
2 |
> On Thu, Mar 14, 2013 at 10:32:30PM -0400, Michael Mol wrote: |
3 |
>>> As to how to accomplish this, it's either a throwaway sig, or poking the |
4 |
>>> agent protocol directly. |
5 |
>> The only trouble with that is if the agent is configured to only unlock |
6 |
>> keys for limited periods of time, then your initial check might catch |
7 |
>> the agent when the key is still unlocked, but your subsequent call to |
8 |
>> GPG comes after the timeout. I ran into this while trying to set up |
9 |
>> automated signing of debian packages I was building. |
10 |
> So Debian has a test-gpg function already? Do you know where in their |
11 |
> codebase it is? |
12 |
|
13 |
No idea; a build system I'd cobbled together at the time prodded |
14 |
gpg-agent to get an interactive auth. The build-and-package step took |
15 |
too long, leading to the timeout. And I apologize; I don't remember |
16 |
exactly what I was doing to prod gpg-agent, and since it was for a prior |
17 |
job, I did not retain any copies of any of the materials. |
18 |
|
19 |
> |
20 |
>> All it really means, in a practical procedural sense, is that you need |
21 |
>> to allow yourself a way to roll back anything you've been doing if that |
22 |
>> later check fails. |
23 |
> I think we'd do: |
24 |
> - All repoman checks |
25 |
> - initial file editing |
26 |
> if two-phase commit: |
27 |
> - test gpg |
28 |
> - commit1 |
29 |
> - gpg sign |
30 |
> - commit2 |
31 |
> if one-phase commit: |
32 |
> - gpg test |
33 |
> - gpg sign |
34 |
> - commit1 |
35 |
> |
36 |
> Unless commit1 took a really long time, the interval between the gpg |
37 |
> calls should be very small. |
38 |
> |
39 |
|
40 |
Murphy's going to call in a long I/O hang somewhere. Race conditions are |
41 |
hell manifest in systems. |
42 |
|
43 |
Since I haven't been paying close attention to this thread, I'm missing |
44 |
some context, but if you're commit1 and commit2 apply to a DVCS, you're |
45 |
probably fine so long as you don't do a push between commit1 and |
46 |
commit2, don't do a push if any earlier step failed, and do all this in |
47 |
a temporary branch that never (as a branch) gets pushed upstream. |
48 |
|
49 |
If you're not applying to a DVCS, then you risk interleaving commit1 and |
50 |
commit2 with others' work anyway. |