Unset IFS in shell scripts in the linux standalone build and OSX app.

This commit is contained in:
Joey Hess 2020-07-24 14:31:11 -04:00
parent 2e241f92c7
commit 24125e8dc4
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
18 changed files with 43 additions and 0 deletions

View file

@ -11,6 +11,7 @@ git-annex (8.20200720.2) UNRELEASED; urgency=medium
* move, copy --to: Sped up seeking files by 2x.
* drop: Sped up seeking files to drop by 2x, and also some performance
improvements to checking numcopies.
* Unset IFS in shell scripts in the linux standalone build and OSX app.
-- Joey Hess <id@joeyh.name> Tue, 21 Jul 2020 12:58:30 -0400

View file

@ -0,0 +1,26 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2020-07-24T18:17:12Z"
content="""
Hmm, so runshell has some things like
for lib in $(cat "$base/libdirs"); do
GIT_ANNEX_LD_LIBRARY_PATH=...
Which, with an unusual IFS, probably set the environment variable to
something bogus. Which seems the kind of thing that could break things
badly enough to segfault.
I have so far not been able to reproduce it, I tried:
tar zxvf ~/src/git-annex/tmp/git-annex-standalone-amd64.tar.gz
cd git-annex.linux/
IFS=$'\013' ./git-annex version
But this may involve the system the standalone build is used in, if the
problem is this is breaking its isolation from that system. So might need a
particular version skew between the two.
I've applied the obvious changes, so please verify the fix.
"""]]

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -3,6 +3,7 @@
# libraries bundled with this app.
set -e
unset IFS
os="$(uname -o 2>/dev/null || true)"
base="$(dirname "$0")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -1,4 +1,5 @@
#!/bin/sh
unset IFS
link="$(readlink "$0")" || true
if [ -n "$link" ]; then
base="$(dirname "$link")"

View file

@ -3,6 +3,7 @@
# bundled with this app.
set -e
unset IFS
base="$(dirname "$0")"