From: Ben Walton <hidden> Date: 2016-06-15 22:52:55
Solaris' /bin/sh was making the IFS setting permanent instead of
temporary when using it to slurp in credentials in the generated
'dump' script of the 'setup helper scripts' test in t0300-credentials.
The stderr file that was being compared to expected-stderr contained the
following stray line from the credential helper run:
warning: invalid credential line: username foo
To avoid this bug, capture the original IFS and force it to be reset
after its use is no longer required. For now, this is lighter weight
than altering which shell these scripts use as their shebang.
Signed-off-by: Ben Walton <redacted>
---
t/t0300-credentials.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
From: Frans Klaver <hidden> Date: 2016-06-15 22:52:55
Wor_k_ around ...
On Thu, 02 Feb 2012 20:32:15 +0100, Ben Walton
[off-list ref] wrote:
quoted hunk
Solaris' /bin/sh was making the IFS setting permanent instead of
temporary when using it to slurp in credentials in the generated
'dump' script of the 'setup helper scripts' test in t0300-credentials.
The stderr file that was being compared to expected-stderr contained the
following stray line from the credential helper run:
warning: invalid credential line: username foo
To avoid this bug, capture the original IFS and force it to be reset
after its use is no longer required. For now, this is lighter weight
than altering which shell these scripts use as their shebang.
Signed-off-by: Ben Walton <redacted>
---
t/t0300-credentials.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
From: Ben Walton <hidden> Date: 2016-06-15 22:52:55
Excerpts from Frans Klaver's message of Thu Feb 02 14:44:08 -0500 2012:
Wor_k_ around ...
*face*palm*
Thanks for catching that.
Junio, can you make that tweak if the patch is ok or would you prefer
a new mail?
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
From: Jeff King <hidden> Date: 2016-06-15 22:52:55
On Thu, Feb 02, 2012 at 02:32:15PM -0500, Ben Walton wrote:
Solaris' /bin/sh was making the IFS setting permanent instead of
temporary when using it to slurp in credentials in the generated
'dump' script of the 'setup helper scripts' test in t0300-credentials.
Hmm. Presumably you are setting SHELL_PATH, as Solaris /bin/sh would be
useless for running the rest of the tests. Usually scripts inside the
tests use #!$SHELL_PATH, but I often don't bother if it's a simple "even
Solaris /bin/sh could run this" script. But in this case I either
underestimated the complexity of my script or overestimated the quality
of the Solaris /bin/sh.
I wonder if a better solution is to use a known-good shell instead of
trying to work around problems in a bogus shell. Does the patch below
fix it for you?
Oh, good catch. Technically "read" is not a special builtin so POSIX shells
are not supposed to do this (and Jeff's patch definitely looks right), but in
any case temporary variable settings while running a builtin are close
enough to the assignment-during-special-builtin-or-function case to
make me shiver a little. ;-)
Would something like
(
IFS==
while read key value
do
...
done
)
make sense?