Skip Menu |
 

Date: Wed, 07 Oct 2020 20:21:26 -0400
CC: "Greg Troxel" <gdt@lexort.com>
From: "Greg Troxel" <gdt@lexort.com>
To: krb5-bugs@mit.edu
Subject: nonportable contsruct in shell script

I help maintain the mit-krb5 package for pgksrc, used on NetBSD.

We have applied the following patch because test_ccapi.sh is a shell
script (with #!/bin/sh) but contains code not permitted by the POSIX
shell standard. (The syntax "[[" is a bash extension.)

Also, my editor appears to have added a missing final newline; that's a
bug in the patch, but something that would be nice to fix too.

Thanks,
Greg





$NetBSD: patch-ccapi_test_test__ccapi.sh,v 1.1 2020/10/05 23:24:45 gdt Exp $

--- ccapi/test/test_ccapi.sh.orig 2020-02-12 17:21:58.000000000 +0000
+++ ccapi/test/test_ccapi.sh
@@ -6,7 +6,7 @@ TEST_DIR="tests"
failure_count=0

function run_test {
- if [[ -e $TEST_DIR/$1 ]]; then
+ if [ -e "$TEST_DIR/$1" ]; then
./$TEST_DIR/$1
failure_count=`expr $failure_count + $?`
fi
@@ -73,4 +73,4 @@ run_test test_cc_get_NC_info

printf "\nFinished testing CCAPI. $failure_count failures in total.\n"

-exit 0
\ No newline at end of file
+exit 0
Download signature.asc
application/pgp-signature 194B

Message body not shown because it is not plain text.

I assume this showed up in a scan of all the shell scripts in the tree with some tool, and wasn't something that caused a problem in practice?  The ccapi directory only gets built on Windows (and used to get build as part of Kerberos for Macintosh, but that's long defunct).
 
Subject: Re: [krbdev.mit.edu #8955] nonportable contsruct in shell script
From: "Greg Troxel" <gdt@lexort.com>
To: "Greg Hudson via RT" <rt@krbdev.mit.edu>
Date: Thu, 08 Oct 2020 07:14:46 -0400

"Greg Hudson via RT" <rt@krbdev.mit.edu> writes:

Show quoted text
> I assume this showed up in a scan of all the shell scripts in the tree with
> some tool, and wasn't something that caused a problem in practice? The ccapi
> directory only gets built on Windows (and used to get build as part of Kerberos
> for Macintosh, but that's long defunct).

Yes. pkgsrc checks for non-portable constructs, because if installed
they could cause a run-time defect. We can exclude things with a
control statement. That said, I favor standards conformance unless it
causes a problem.
Download signature.asc
application/pgp-signature 194B

Message body not shown because it is not plain text.