* [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x)
@ 2011-01-11 15:21 Sascha Silbe
2011-01-11 15:34 ` Ben Walton
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sascha Silbe @ 2011-01-11 15:21 UTC (permalink / raw)
To: sup-devel
Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
running (using a well-known socket location). When using GnuPG 1.x gpg-agent
needs to already be running at the time sup is started because the socket
location is random and passed via environment variables.
Autostarting gpg-agent is particularly convenient when using sup via ssh
as gpg-agent would need to be started manually otherwise (for local X
sessions OTOH it's often started automatically by distro scripts).
Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
lib/sup/crypto.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
If there's anyone who would like to stick to GnuPG 1.x (the only advantage
is the smaller size of the binary), we might need to make this configurable
(or overridable via the gpg-args hook).
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 537745d..916f04c 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -25,7 +25,7 @@ EOS
def initialize
@mutex = Mutex.new
- bin = `which gpg`.chomp
+ bin = `which gpg2`.chomp
@cmd = case bin
when /\S/
debug "crypto: detected gpg binary in #{bin}"
--
1.7.2.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x)
2011-01-11 15:21 [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x) Sascha Silbe
@ 2011-01-11 15:34 ` Ben Walton
2011-01-11 15:45 ` Alvaro Herrera
2011-01-11 18:59 ` [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over " Sascha Silbe
2 siblings, 0 replies; 8+ messages in thread
From: Ben Walton @ 2011-01-11 15:34 UTC (permalink / raw)
To: sup-devel
Excerpts from Sascha Silbe's message of Tue Jan 11 10:21:53 -0500 2011:
Hi Sascha,
> Since 1.9.14 GnuPG can automatically start gpg-agent if it's not
> already running (using a well-known socket location). When using
> GnuPG 1.x gpg-agent needs to already be running at the time sup is
> started because the socket location is random and passed via
> environment variables.
I like the intent of this patch, but at the very least, it should
determine if gpg2 is available and then fall back to gpg if it's not.
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x)
2011-01-11 15:21 [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x) Sascha Silbe
2011-01-11 15:34 ` Ben Walton
@ 2011-01-11 15:45 ` Alvaro Herrera
2011-01-11 18:30 ` Sascha Silbe
2011-01-11 18:59 ` [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over " Sascha Silbe
2 siblings, 1 reply; 8+ messages in thread
From: Alvaro Herrera @ 2011-01-11 15:45 UTC (permalink / raw)
To: Sascha Silbe; +Cc: sup-devel
Excerpts from Sascha Silbe's message of mar ene 11 12:21:53 -0300 2011:
> Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
> running (using a well-known socket location). When using GnuPG 1.x gpg-agent
> needs to already be running at the time sup is started because the socket
> location is random and passed via environment variables.
>
> Autostarting gpg-agent is particularly convenient when using sup via ssh
> as gpg-agent would need to be started manually otherwise (for local X
> sessions OTOH it's often started automatically by distro scripts).
I think it should fall back to using `which gpg` in case gpg2 is not
available.
--
Álvaro Herrera <alvherre@alvh.no-ip.org>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x)
2011-01-11 15:45 ` Alvaro Herrera
@ 2011-01-11 18:30 ` Sascha Silbe
0 siblings, 0 replies; 8+ messages in thread
From: Sascha Silbe @ 2011-01-11 18:30 UTC (permalink / raw)
To: Alvaro Herrera; +Cc: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 274 bytes --]
Excerpts from Alvaro Herrera's message of Tue Jan 11 16:45:09 +0100 2011:
> I think it should fall back to using `which gpg` in case gpg2 is not
> available.
Good point. Will post a new version.
Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
2011-01-11 15:21 [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x) Sascha Silbe
2011-01-11 15:34 ` Ben Walton
2011-01-11 15:45 ` Alvaro Herrera
@ 2011-01-11 18:59 ` Sascha Silbe
2011-01-11 20:20 ` Gaudenz Steinlin
2 siblings, 1 reply; 8+ messages in thread
From: Sascha Silbe @ 2011-01-11 18:59 UTC (permalink / raw)
To: sup-devel
Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
running (using a well-known socket location). When using GnuPG 1.x gpg-agent
needs to already be running at the time sup is started because the socket
location is random and passed via environment variables.
Autostarting gpg-agent is particularly convenient when using sup via ssh
as gpg-agent would need to be started manually (for local X sessions OTOH
it's often started automatically by distro scripts).
Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
lib/sup/crypto.rb | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
v1->v2:
fallback to gpg if gpg2 is not available
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 537745d..16ebaf9 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -25,9 +25,10 @@ EOS
def initialize
@mutex = Mutex.new
- bin = `which gpg`.chomp
- @cmd = case bin
- when /\S/
+ @cmd = if (bin = `which gpg2`.chomp) =~ /\S/
+ debug "crypto: detected gpg binary in #{bin}"
+ "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
+ elsif (bin = `which gpg`.chomp) =~ /\S/
debug "crypto: detected gpg binary in #{bin}"
"#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
else
--
1.7.2.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
2011-01-11 18:59 ` [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over " Sascha Silbe
@ 2011-01-11 20:20 ` Gaudenz Steinlin
2011-01-18 18:20 ` Sascha Silbe
0 siblings, 1 reply; 8+ messages in thread
From: Gaudenz Steinlin @ 2011-01-11 20:20 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 1816 bytes --]
Excerpts from Sascha Silbe's message of Die Jan 11 19:59:43 +0100 2011:
> Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
> running (using a well-known socket location). When using GnuPG 1.x gpg-agent
> needs to already be running at the time sup is started because the socket
> location is random and passed via environment variables.
>
> Autostarting gpg-agent is particularly convenient when using sup via ssh
> as gpg-agent would need to be started manually (for local X sessions OTOH
> it's often started automatically by distro scripts).
AFAICS this change is not compatible with the rework of the GPG
handling done in the gpgme branch. I was under the impression (from
previous discussion on this list) that this branch is going to be
merged soon (at least into next).
Gaudenz
>
> Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
> ---
> lib/sup/crypto.rb | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> v1->v2:
> fallback to gpg if gpg2 is not available
>
> diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
> index 537745d..16ebaf9 100644
> --- a/lib/sup/crypto.rb
> +++ b/lib/sup/crypto.rb
> @@ -25,9 +25,10 @@ EOS
> def initialize
> @mutex = Mutex.new
>
> - bin = `which gpg`.chomp
> - @cmd = case bin
> - when /\S/
> + @cmd = if (bin = `which gpg2`.chomp) =~ /\S/
> + debug "crypto: detected gpg binary in #{bin}"
> + "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
> + elsif (bin = `which gpg`.chomp) =~ /\S/
> debug "crypto: detected gpg binary in #{bin}"
> "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
> else
--
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 482 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
2011-01-11 20:20 ` Gaudenz Steinlin
@ 2011-01-18 18:20 ` Sascha Silbe
2011-01-19 3:37 ` Rich Lane
0 siblings, 1 reply; 8+ messages in thread
From: Sascha Silbe @ 2011-01-18 18:20 UTC (permalink / raw)
To: sup-devel
Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
running (using a well-known socket location). When using GnuPG 1.x gpg-agent
needs to already be running at the time sup is started because the socket
location is random and passed via environment variables.
Autostarting gpg-agent is particularly convenient when using sup via ssh
as gpg-agent would need to be started manually (for local X sessions OTOH
it's often started automatically by distro scripts).
Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
v1->v2: rebase on next
lib/sup/crypto.rb | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 02f14d0..f44efb3 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -48,6 +48,11 @@ EOS
GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
rescue NameError, GPGME::Error
@gpgme_present = false
+ return
+ end
+
+ if (bin = `which gpg2`.chomp) =~ /\S/
+ GPGME.set_engine_info GPGME::PROTOCOL_OpenPGP, bin, nil
end
end
--
1.7.2.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
2011-01-18 18:20 ` Sascha Silbe
@ 2011-01-19 3:37 ` Rich Lane
0 siblings, 0 replies; 8+ messages in thread
From: Rich Lane @ 2011-01-19 3:37 UTC (permalink / raw)
To: Sascha Silbe; +Cc: sup-devel
Applied to master.
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-01-19 4:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-11 15:21 [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x) Sascha Silbe
2011-01-11 15:34 ` Ben Walton
2011-01-11 15:45 ` Alvaro Herrera
2011-01-11 18:30 ` Sascha Silbe
2011-01-11 18:59 ` [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over " Sascha Silbe
2011-01-11 20:20 ` Gaudenz Steinlin
2011-01-18 18:20 ` Sascha Silbe
2011-01-19 3:37 ` Rich Lane
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox