diff options
author | Werner Koch <[email protected]> | 2012-11-08 16:16:40 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-11-08 16:16:40 +0000 |
commit | 95347cf950e2e26d1726791f9f4278af70dccce9 (patch) | |
tree | 3c76c4133b82a08ad5b8bbb5112ca9851c77c7ca | |
parent | de.po: Grammar fix (diff) | |
download | gnupg-95347cf950e2e26d1726791f9f4278af70dccce9.tar.gz gnupg-95347cf950e2e26d1726791f9f4278af70dccce9.zip |
tests: Skip secret key import check in SELinux mode
* configure.ac (ENABLE_SELINUX_HACKS): New am_conditional.
* checks/Makefile.am (prepared.stamp): Replace by defs-config.inc.
(defs-config.inc): Create and set enable_selinux_hacks variable.
* checks/defs.inc: Include defs-config.inc.
* checks/armor.test: Do not run the last test in selinux mode.
GnuPG-bug-id: 1390
-rw-r--r-- | checks/Makefile.am | 21 | ||||
-rwxr-xr-x | checks/armor.test | 10 | ||||
-rwxr-xr-x | checks/defs.inc | 9 | ||||
-rw-r--r-- | configure.ac | 1 |
4 files changed, 29 insertions, 12 deletions
diff --git a/checks/Makefile.am b/checks/Makefile.am index 70ae58b0b..0cfbe1c8f 100644 --- a/checks/Makefile.am +++ b/checks/Makefile.am @@ -6,12 +6,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. -# +# # GnuPG is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. # Process this file with automake to create Makefile.in @@ -39,22 +39,29 @@ DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \ mkdemodirs signdemokey -CLEANFILES = prepared.stamp x y yy z out err $(DATA_FILES) \ +CLEANFILES = defs-config.inc x y yy z out err $(DATA_FILES) \ plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \ *.test.log gpg_dearmor gpg.conf \ pubring.gpg secring.gpg pubring.pkr secring.skr DISTCLEANFILES = pubring.gpg~ random_seed -all-local: prepared.stamp +all-local: defs-config.inc distclean-local: $(srcdir)/mkdemodirs --clean -prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \ +defs-config.inc: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \ ./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES) - $(GPG_IMPORT) $(srcdir)/pubdemo.asc - echo timestamp >./prepared.stamp + $(GPG_IMPORT) $(srcdir)/pubdemo.asc + echo '# Do not edit - created by the Makefile. -*- sh -*-' \ + > defs-config.inc +if ENABLE_SELINUX_HACKS + echo enable_selinux_hacks=yes >> defs-config.inc +else + echo enable_selinux_hacks=no >> defs-config.inc +endif + ./gpg_dearmor: echo '#!/bin/sh' >./gpg_dearmor diff --git a/checks/armor.test b/checks/armor.test index 9fb92925b..cfd235969 100755 --- a/checks/armor.test +++ b/checks/armor.test @@ -739,9 +739,14 @@ wg7Md81a5RI3F2FG8747t9gX # armor filter gpg swalled the CRC line and passed the '-----END...' # line on to the decryption layer. -# Can only perform this test if we have Twofish +# Can only perform this test if we have Twofish. We also can't use it +# if we have SELinux support, because that will fail on secret key +# import. -if $GPG --with-colons --list-config ciphername | grep TWOFISH > /dev/null 2>/dev/null ; then +if test x$enable_selinux_hacks = xyes ; then + echo "SELinux support is enabled: skipping secret key import check" +else + if $GPG --with-colons --list-config ciphername | grep TWOFISH > /dev/null 2>/dev/null ; then i=alpha_seckey info "importing: $i" eval "(IFS=; echo \"\$$i\")" >x @@ -755,4 +760,5 @@ if $GPG --with-colons --list-config ciphername | grep TWOFISH > /dev/null 2>/dev else error "bug#1179 is back in town" fi + fi fi diff --git a/checks/defs.inc b/checks/defs.inc index 080db3b45..564828b98 100755 --- a/checks/defs.inc +++ b/checks/defs.inc @@ -1,9 +1,12 @@ -# definitions for the check scripts +# definitions for the check scripts -*- sh -*- #-------------------------------- #------ constants --------------- #-------------------------------- +# First the Makefile generated constants +. ./defs-config.inc || exit 3 + # Note that usrpass1 is also used in Makefile.am usrname1="one" usrpass1="def" @@ -50,7 +53,7 @@ error () { defs_error_seen=yes echo "$pgmname:" $* >&5 if [ x$defs_stop_on_error != xyes ]; then - exit 1 + exit 1 fi } @@ -115,7 +118,7 @@ echo_n () { # Special function for zOS. my_chtag () { - #FIXME: Is there an envvar to test for the OS or do we + #FIXME: Is there an envvar to test for the OS or do we # need to resort to a configure test #if test "$FOO" = "bar"; then # chtag -tc ISO8859-1 $1 diff --git a/configure.ac b/configure.ac index 275cdb883..80d6e8a15 100644 --- a/configure.ac +++ b/configure.ac @@ -920,6 +920,7 @@ fi AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes) AM_CONDITIONAL(ENABLE_AGENT_SUPPORT, test "$agent_support" = yes) +AM_CONDITIONAL(ENABLE_SELINUX_HACKS, test "$selinux_support" = yes) dnl Checks for header files. AC_HEADER_STDC |