aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2025-09-25 05:11:54 +0000
committerNIIBE Yutaka <[email protected]>2025-09-25 05:11:54 +0000
commit7b479ee9faca2215d58d34437ff8b0b7815549bf (patch)
treee9122cc496c7bf0c86cacd19b49c427aaff65adb
parentdirmngr: Fix assertion failure due to wrong buffer length computation. (diff)
downloadgnupg-7b479ee9faca2215d58d34437ff8b0b7815549bf.tar.gz
gnupg-7b479ee9faca2215d58d34437ff8b0b7815549bf.zip
Fixes for -a and -o for test(1).
* build-aux/potomo: Avoid using -a and -o for test(1). * configure.ac: Likewise. * tests/pkits/common.sh: Likewise. * tests/tpm2dtests/Makefile.am: Likewise. * tools/applygnupgdefaults: Likewise. * tools/gpg-authcode-sign.sh: Likewise. * tools/mail-signed-keys: Likewise. -- GnuPG-bug-id: 7807 Signed-off-by: NIIBE Yutaka <[email protected]>
-rwxr-xr-xbuild-aux/potomo2
-rw-r--r--configure.ac7
-rw-r--r--tests/pkits/common.sh2
-rw-r--r--tests/tpm2dtests/Makefile.am2
-rwxr-xr-xtools/applygnupgdefaults4
-rwxr-xr-xtools/gpg-authcode-sign.sh4
-rwxr-xr-xtools/mail-signed-keys4
7 files changed, 13 insertions, 12 deletions
diff --git a/build-aux/potomo b/build-aux/potomo
index b4c0a6b5c..a24c900d3 100755
--- a/build-aux/potomo
+++ b/build-aux/potomo
@@ -17,7 +17,7 @@
# sure while creating the mo. A conversion is not done if the source
# file does not exist or if it is not newer than the mo file.
-if [ "$1" = "--get-linguas" -a $# -eq 2 ]; then
+if [ "$1" = "--get-linguas" ] && [ $# -eq 2 ]; then
if [ ! -f "$2/LINGUAS" ]; then
echo "potomo: directory '$2' has no LINGUAS file" >&2
exit 1
diff --git a/configure.ac b/configure.ac
index 5a89cd9aa..23ce6caff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1427,7 +1427,7 @@ fi
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
# Dirmngr requires mmap on Unix systems.
-if test $ac_cv_func_mmap != yes -a $mmap_needed = yes; then
+if test $ac_cv_func_mmap != yes && test $mmap_needed = yes; then
AC_MSG_ERROR([[Sorry, the current implementation requires mmap.]])
fi
@@ -1611,7 +1611,8 @@ fi
AC_SUBST(LIBTSS_LIBS)
AC_SUBST(LIBTSS_CFLAGS)
AM_CONDITIONAL(HAVE_LIBTSS, test "$have_libtss" != no)
-AM_CONDITIONAL(TEST_LIBTSS, test -n "$SWTPM" -o -n "$TPMSERVER" -a -n "$TSSSTARTUP")
+AM_CONDITIONAL(TEST_LIBTSS, [test -n "$SWTPM" \
+ || { test -n "$TPMSERVER" && test -n "$TSSSTARTUP; }"])
AC_SUBST(HAVE_LIBTSS)
#
@@ -2146,7 +2147,7 @@ echo "
TOFU support: $use_tofu
Tor support: $show_tor_support
"
-if test "$have_libtss" != no -a -z "$TPMSERVER" -a -z "$SWTPM"; then
+if test "$have_libtss" != no && test -z "$TPMSERVER" && test -z "$SWTPM"; then
cat <<G10EOF
Warning: TPM support is compiled in but no software TPM
for testing was discovered. TPM tests are disabled
diff --git a/tests/pkits/common.sh b/tests/pkits/common.sh
index 697f28f67..1f9293ecc 100644
--- a/tests/pkits/common.sh
+++ b/tests/pkits/common.sh
@@ -189,7 +189,7 @@ final_result () {
[ $fail_count = 0 ] || info "$fail_count tests failed"
[ $skip_count = 0 ] || info "$unsupported_count tests skipped"
[ $unresolved_count = 0 ] || info "$unresolved_count tests unresolved"
- [ -z "$debug" -a -f "$SCRATCH" ] && rm "$SCRATCH"
+ [ -z "$debug" ] && [ -f "$SCRATCH" ] && rm "$SCRATCH"
if [ $fail_count = 0 ]; then
info "all tests passed"
else
diff --git a/tests/tpm2dtests/Makefile.am b/tests/tpm2dtests/Makefile.am
index ceaf56420..6eab563f1 100644
--- a/tests/tpm2dtests/Makefile.am
+++ b/tests/tpm2dtests/Makefile.am
@@ -60,7 +60,7 @@ xcheck: tpm_server_found
$(abs_srcdir)/run-tests.scm $(TESTFLAGS) $(TESTS)
tpm_server_found:
- @if [ -z "$(TPMSERVER)" -a -z "$(SWTPM)" -a -z "$(FORCE)" ]; then echo "ERROR: No Software TPM has been found, cannot run TPM tests. Set FORCE=1 to force using the physical TPM"; exit 1; fi
+ @if [ -z "$(TPMSERVER)" ] && [ -z "$(SWTPM)" ] && [ -z "$(FORCE)" ]; then echo "ERROR: No Software TPM has been found, cannot run TPM tests. Set FORCE=1 to force using the physical TPM"; exit 1; fi
EXTRA_DIST = defs.scm shell.scm all-tests.scm run-tests.scm $(XTESTS) \
start_sw_tpm.sh setup.scm
diff --git a/tools/applygnupgdefaults b/tools/applygnupgdefaults
index 316509faf..921e46986 100755
--- a/tools/applygnupgdefaults
+++ b/tools/applygnupgdefaults
@@ -31,11 +31,11 @@ fi
# Cleanup on exit
cleanup ()
{
- [ -n "$errorfile" -a -f "$errorfile" ] && rm "$errorfile"
+ [ -n "$errorfile" ] && [ -f "$errorfile" ] && rm "$errorfile"
}
trap cleanup EXIT SIGINT SIGHUP SIGPIPE
errorfile=$(mktemp "/tmp/$PGM.log.XXXXXX")
-[ -n "$errorfile" -a -f "$errorfile" ] || exit 2
+{ [ -n "$errorfile" ] && [ -f "$errorfile" ]; } || exit 2
# Check whether we can use getent
if getent --help </dev/null >/dev/null 2>&1 ; then
diff --git a/tools/gpg-authcode-sign.sh b/tools/gpg-authcode-sign.sh
index 91e33bcec..ad4d1450c 100755
--- a/tools/gpg-authcode-sign.sh
+++ b/tools/gpg-authcode-sign.sh
@@ -101,7 +101,7 @@ dryrun=
stamp=
buildtype=
# Set defaults according to our build system.
-if [ -n "$abs_top_srcdir" -a -f "$abs_top_srcdir/packages/BUILDTYPE" ]; then
+if [ -n "$abs_top_srcdir" ] && [ -f "$abs_top_srcdir/packages/BUILDTYPE" ]; then
buildtype=$(cat "$abs_top_srcdir/packages/BUILDTYPE")
elif [ -f "../packages/BUILDTYPE" ]; then
buildtype=$(cat "../packages/BUILDTYPE")
@@ -190,7 +190,7 @@ fi
# Define the cleanup routine for osslsigncode
cleanup()
{
- if [ -n "$outname" -a -f "${outname}.tmp" ]; then
+ if [ -n "$outname" ] && [ -f "${outname}.tmp" ]; then
echo >&2 "Cleaning up: Removing ${outname}.tmp"
rm -f "${outname}.tmp"
fi
diff --git a/tools/mail-signed-keys b/tools/mail-signed-keys
index 263b8e535..540293c3b 100755
--- a/tools/mail-signed-keys
+++ b/tools/mail-signed-keys
@@ -17,7 +17,7 @@ if [ "$1" = "--dry-run" ]; then
shift
fi
-if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
+if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
echo "usage: mail-signed-keys keyring signedby signame" >&2
exit 1
fi
@@ -44,7 +44,7 @@ if [ "$dryrun" = "0" ]; then
echo "About to send the keys signed by $signedby" >&2
echo -n "to their owners. Do you really want to do this? (y/N)" >&2
read
- [ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
+ [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ] && exit 0
fi
gpg $ro --check-sigs --with-colons 2>/dev/null \