[pinentry] Improve wrapper to fallback to curses even with DISPLAY set (#622077)

Stanislav Ochotnicky sochotni at fedoraproject.org
Tue Jul 26 08:28:14 UTC 2011


commit 7db36dd56dcb9da53c29f6894b38c71633c12d36
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Tue Jul 26 10:02:16 2011 +0200

    Improve wrapper to fallback to curses even with DISPLAY set (#622077)
    
    - improved wrapper provided by Ben Boeckel

 pinentry-wrapper |    7 ++++---
 pinentry.spec    |    5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/pinentry-wrapper b/pinentry-wrapper
index 6d019d7..99bd6b2 100644
--- a/pinentry-wrapper
+++ b/pinentry-wrapper
@@ -59,7 +59,10 @@ then
 elif [ -x /usr/bin/pinentry-qt ]
 then
 	export PINENTRY_BINARY="/usr/bin/pinentry-qt"
-# pinentry-curses is installed by default 
+# pinentry-curses is installed by default, test if we're in a terminal
+elif [ -t 2 ]
+then
+	export PINENTRY_BINARY="/usr/bin/pinentry-curses"
 else
 	#test if gui binary is required
 	for opt in "$@"; do
@@ -69,8 +72,6 @@ else
 			exit 1
 		fi
 	done
-	export PINENTRY_BINARY="/usr/bin/pinentry-curses"
-		
 fi
 fi
 
diff --git a/pinentry.spec b/pinentry.spec
index c576072..7fbe2d3 100644
--- a/pinentry.spec
+++ b/pinentry.spec
@@ -17,7 +17,7 @@
 
 Name:    pinentry
 Version: 0.8.1
-Release: 3%{?dist}
+Release: 4%{?dist}
 Summary: Collection of simple PIN or passphrase entry dialogs
 
 Group:   Applications/System
@@ -189,6 +189,9 @@ fi
 
 
 %changelog
+* Tue Jul 26 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.8.1-4
+- Improve wrapper to fallback to curses even with DISPLAY set (#622077)
+
 * Fri Feb 18 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.8.1-3
 - Fix pinentry-curses running as root by disabling capabilities (#677670)
 


More information about the scm-commits mailing list