Skip to content

Commit 2c784e4

Browse files
committed
Look for functions.sh in /etc too (fix osresearch#153)
1 parent 86323a3 commit 2c784e4

File tree

9 files changed

+27
-4
lines changed

9 files changed

+27
-4
lines changed

Diff for: sbin/attest-enroll

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
2727
elif [[ -s $TOP/functions.sh ]]; then
2828
# shellcheck source=functions.sh
2929
. "$TOP/functions.sh"
30+
elif [[ -s /etc/safeboot/functions.sh ]]; then
31+
# shellcheck source=functions.sh
32+
. /etc/safeboot/functions.sh
3033
else
3134
echo "Unable to find Safeboot function library" 1>&2
3235
exit 1

Diff for: sbin/gencert

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
1515
elif [[ -s $TOP/functions.sh ]]; then
1616
# shellcheck disable=SC1090 source=functions.sh
1717
. "$TOP/functions.sh"
18+
elif [[ -s /etc/safeboot/functions.sh ]]; then
19+
# shellcheck source=functions.sh
20+
. /etc/safeboot/functions.sh
1821
else
1922
echo "Unable to find Safeboot function library" 1>&2
2023
exit 1

Diff for: sbin/genkeytab

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
1515
elif [[ -s $TOP/functions.sh ]]; then
1616
# shellcheck disable=SC1090 source=functions.sh
1717
. "$TOP/functions.sh"
18+
elif [[ -s /etc/safeboot/functions.sh ]]; then
19+
# shellcheck source=functions.sh
20+
. /etc/safeboot/functions.sh
1821
else
1922
echo "Unable to find Safeboot function library" 1>&2
2023
exit 1

Diff for: sbin/getkeytab

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
3535
elif [[ -s $TOP/functions.sh ]]; then
3636
# shellcheck disable=SC1090 source=functions.sh
3737
. "$TOP/functions.sh"
38+
elif [[ -s /etc/safeboot/functions.sh ]]; then
39+
# shellcheck source=functions.sh
40+
. /etc/safeboot/functions.sh
3841
else
3942
echo "Unable to find Safeboot function library" 1>&2
4043
exit 1

Diff for: sbin/safeboot

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
3333
elif [[ -s $TOP/functions.sh ]]; then
3434
# shellcheck source=functions.sh
3535
. "$TOP/functions.sh"
36+
elif [[ -s /etc/safeboot/functions.sh ]]; then
37+
# shellcheck source=functions.sh
38+
. /etc/safeboot/functions.sh
3639
else
3740
echo "Unable to find Safeboot function library" 1>&2
3841
exit 1

Diff for: sbin/tpm2-attest

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
3030
elif [[ -s $TOP/functions.sh ]]; then
3131
# shellcheck source=functions.sh
3232
. "$TOP/functions.sh"
33+
elif [[ -s /etc/safeboot/functions.sh ]]; then
34+
# shellcheck source=functions.sh
35+
. /etc/safeboot/functions.sh
3336
else
3437
echo "Unable to find Safeboot function library" 1>&2
3538
exit 1

Diff for: sbin/tpm2-policy

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ TOP=$(dirname "$BINDIR")
77
if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
88
# shellcheck disable=SC1090 source=functions.sh
99
. "$TOP/lib/safeboot/functions.sh"
10-
functions_sh=$TOP/lib/safeboot/functions.sh
1110
elif [[ -s $TOP/functions.sh ]]; then
1211
# shellcheck disable=SC1090 source=functions.sh
1312
. "$TOP/functions.sh"
14-
functions_sh=$TOP/functions.sh
13+
elif [[ -s /etc/safeboot/functions.sh ]]; then
14+
# shellcheck disable=SC1090 source=functions.sh
15+
. /etc/safeboot/functions.sh
1516
else
1617
echo "Unable to find Safeboot function library" 1>&2
1718
exit 1
1819
fi
19-
# shellcheck source=functions.sh
20-
. "$functions_sh"
2120

2221
set -euo pipefail -o noclobber
2322
shopt -s extglob

Diff for: sbin/tpm2-recv

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
1010
elif [[ -s $TOP/functions.sh ]]; then
1111
# shellcheck disable=SC1090 source=functions.sh
1212
. "$TOP/functions.sh"
13+
elif [[ -s /etc/safeboot/functions.sh ]]; then
14+
# shellcheck source=functions.sh
15+
. /etc/safeboot/functions.sh
1316
else
1417
echo "Unable to find Safeboot function library" 1>&2
1518
exit 1

Diff for: sbin/tpm2-send

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [[ -s $TOP/lib/safeboot/functions.sh ]]; then
1010
elif [[ -s $TOP/functions.sh ]]; then
1111
# shellcheck disable=SC1090 source=functions.sh
1212
. "$TOP/functions.sh"
13+
elif [[ -s /etc/safeboot/functions.sh ]]; then
14+
# shellcheck source=functions.sh
15+
. /etc/safeboot/functions.sh
1316
else
1417
echo "Unable to find Safeboot function library" 1>&2
1518
exit 1

0 commit comments

Comments
 (0)