[16699] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #8979] Portability bug in aclocal.m4

daemon@ATHENA.MIT.EDU (Brook Milligan via RT)
Tue Jan 19 00:18:54 2021

From: "Brook Milligan via RT" <rt-comment@krbdev.mit.edu>
In-Reply-To: <71999065-8334-4686-951C-8611487DA18E@nmsu.edu>
Message-ID: <rt-4.4.4-20963-1611033527-762.8979-4-0@mit.edu>
To: "AdminCc of krbdev.mit.edu Ticket #8979":;
Date: Tue, 19 Jan 2021 00:18:47 -0500
MIME-Version: 1.0
Reply-To: rt-comment@krbdev.mit.edu
Content-Type: text/plain; charset="utf-8"
Errors-To: krb5-bugs-bounces@mit.edu
Content-Transfer-Encoding: 8bit


Tue Jan 19 00:18:47 2021: Request 8979 was acted upon.
 Transaction: Ticket created by brook@nmsu.edu
       Queue: krb5
     Subject: Portability bug in aclocal.m4
       Owner: Nobody
  Requestors: brook@nmsu.edu
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=8979 >


Empty bodies in shell conditionals are not portable.  Some shells allow them; others do not.  POSIX does not allow them other than as an extension.  As a consequence, including empty conditional bodies in configure scripts intended to be portable is a bug.

An empty conditional body can occur in the configure script generated for Kerberos by the following code fragment in aclocal.m4.  If AC_CONFIG_AUX_DIR() generates no code, this conditional reduces to "if condition; then else … fi” with an empty then body.  Some shells then fail with an “unexpected else” error.

The correct fix seems to be to add a colon to ensure that the then body is never empty.

Cheers,
Brook

--- aclocal.m4.orig	2020-05-22 00:21:40.000000000 +0000
+++ aclocal.m4
@@ -15,6 +15,7 @@ ac_config_fragdir=$ac_reltopdir/config
 # echo "Looking for $srcdir/$ac_config_fragdir"
 if test -d "$srcdir/$ac_config_fragdir"; then
   AC_CONFIG_AUX_DIR(K5_TOPDIR/config)
+  :
 else
   AC_MSG_ERROR([can not find config/ directory in $ac_reltopdir])
 fi



_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs


home help back first fref pref prev next nref lref last post