10
10
11
11
config=$1
12
12
13
+ unset CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
14
+
13
15
TEST_TARGET=" tests"
14
16
LTESTS=" "
15
17
SKIP_LTESTS=" "
@@ -32,19 +34,72 @@ case "$config" in
32
34
TEST_TARGET=t-exec
33
35
;;
34
36
cygwin-release)
35
- CONFIGFLAGS=" --with-libedit --with-xauth=/usr/bin/xauth --disable-strip --with-security-key-builtin"
37
+ # See https://cygwin.com/git/?p=git/cygwin-packages/openssh.git;a=blob;f=openssh.cygport;hb=HEAD
38
+ CONFIGFLAGS=" --with-xauth=/usr/bin/xauth --with-security-key-builtin"
39
+ CONFIGFLAGS=" $CONFIGFLAGS --with-kerberos5=/usr --with-libedit --disable-strip"
36
40
;;
37
41
clang-12-Werror)
38
42
CC=" clang-12"
39
43
# clang's implicit-fallthrough requires that the code be annotated with
40
44
# __attribute__((fallthrough)) and does not understand /* FALLTHROUGH */
41
- CFLAGS=" -Wall -Wextra -O2 -Wno-error=implicit-fallthrough"
45
+ CFLAGS=" -Wall -Wextra -O2 -Wno-error=implicit-fallthrough -Wno-error=unused-parameter "
42
46
CONFIGFLAGS=" --with-pam --with-Werror"
43
47
;;
48
+ * -sanitize-* )
49
+ case " $config " in
50
+ gcc-* )
51
+ CC=gcc
52
+ ;;
53
+ clang-* )
54
+ # Find the newest available version of clang
55
+ for i in ` seq 10 99` ; do
56
+ clang=" ` which clang-$i 2> /dev/null` "
57
+ [ -x " $clang " ] && CC=" $clang "
58
+ done
59
+ ;;
60
+ esac
61
+ # Put Sanitizer logs in regress dir.
62
+ SANLOGS=` pwd` /regress
63
+ # - We replace chroot with chdir so that the sanitizer in the preauth
64
+ # privsep process can read /proc.
65
+ # - clang does not recognizes explicit_bzero so we use bzero
66
+ # (see https://github.com/google/sanitizers/issues/1507
67
+ # - openssl and zlib trip ASAN.
68
+ # - sp_pwdp returned by getspnam trips ASAN, hence disabling shadow.
69
+ case " $config " in
70
+ * -sanitize-address)
71
+ CFLAGS=" -fsanitize=address -fno-omit-frame-pointer"
72
+ LDFLAGS=" -fsanitize=address"
73
+ CPPFLAGS=' -Dchroot=chdir -Dexplicit_bzero=bzero -D_FORTIFY_SOURCE=0 -DASAN_OPTIONS=\"detect_leaks=0:log_path=' $SANLOGS ' /asan.log\"'
74
+ CONFIGFLAGS=" "
75
+ TEST_TARGET=" t-exec"
76
+ ;;
77
+ clang-sanitize-memory)
78
+ CFLAGS=" -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer"
79
+ LDFLAGS=" -fsanitize=memory"
80
+ CPPFLAGS=' -Dchroot=chdir -Dexplicit_bzero=bzero -DMSAN_OPTIONS=\"log_path=' $SANLOGS ' /msan.log\"'
81
+ CONFIGFLAGS=" --without-openssl --without-zlib --without-shadow"
82
+ TEST_TARGET=" t-exec"
83
+ ;;
84
+ * -sanitize-undefined)
85
+ CFLAGS=" -fsanitize=undefined"
86
+ LDFLAGS=" -fsanitize=undefined"
87
+ ;;
88
+ * )
89
+ echo unknown sanitize option;
90
+ exit 1;;
91
+ esac
92
+ features=" --disable-security-key --disable-pkcs11"
93
+ hardening=" --without-sandbox --without-hardening --without-stackprotect"
94
+ privsep=" --with-privsep-user=root"
95
+ CONFIGFLAGS=" $CONFIGFLAGS $features $hardening $privsep "
96
+ # Because we hobble chroot we can't test it.
97
+ SKIP_LTESTS=sftp-chroot
98
+ ;;
44
99
gcc-11-Werror)
45
100
CC=" gcc"
46
101
# -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled
47
- CFLAGS=" -Wall -Wextra -Wno-format-truncation -O2 - Wimplicit-fallthrough=4"
102
+ CFLAGS=" -Wall -Wextra -O2 - Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter "
48
103
CONFIGFLAGS=" --with-pam --with-Werror"
49
104
;;
50
105
clang* |gcc* )
@@ -107,14 +162,15 @@ case "$config" in
107
162
# Valgrind slows things down enough that the agent timeout test
108
163
# won't reliably pass, and the unit tests run longer than allowed
109
164
# by github so split into three separate tests.
110
- tests2=" rekey integrity try-ciphers sftp "
111
- tests3=" krl forward-control sshsig agent-restrict kextype"
165
+ tests2=" rekey integrity try-ciphers"
166
+ tests3=" krl forward-control sshsig agent-restrict kextype sftp "
112
167
tests4=" cert-userkey cert-hostkey kextype sftp-perm keygen-comment percent"
113
168
case " $config " in
114
169
valgrind-1)
115
170
# All tests except agent-timeout (which is flaky under valgrind)
116
- # ) and slow ones that run separately to increase parallelism.
117
- SKIP_LTESTS=" agent-timeout ${tests2} ${tests3} ${tests4} "
171
+ # and hostbased (since valgrind won't let ssh exec keysign).
172
+ # Slow ones are run separately to increase parallelism.
173
+ SKIP_LTESTS=" agent-timeout hostbased ${tests2} ${tests3} ${tests4} "
118
174
;;
119
175
valgrind-2)
120
176
LTESTS=" ${tests2} "
@@ -145,10 +201,23 @@ case "$config" in
145
201
esac
146
202
147
203
case " ${TARGET_HOST} " in
204
+ aix* )
205
+ # These are slow real or virtual machines so skip the slowest tests
206
+ # (which tend to be thw ones that transfer lots of data) so that the
207
+ # test run does not time out.
208
+ # The agent-restrict test fails due to some quoting issue when run
209
+ # with sh or ksh so specify bash for now.
210
+ TEST_TARGET=" t-exec TEST_SHELL=bash"
211
+ SKIP_LTESTS=" rekey sftp"
212
+ ;;
148
213
dfly58* |dfly60* )
149
214
# scp 3-way connection hangs on these so skip until sorted.
150
215
SKIP_LTESTS=scp3
151
216
;;
217
+ fbsd6)
218
+ # Native linker is not great with PIC so OpenSSL is built w/out.
219
+ CONFIGFLAGS=" ${CONFIGFLAGS} --disable-security-key"
220
+ ;;
152
221
hurd)
153
222
SKIP_LTESTS=" forwarding multiplex proxy-connect hostkey-agent agent-ptrace"
154
223
;;
@@ -173,6 +242,10 @@ case "${TARGET_HOST}" in
173
242
# SHA256 functions in sha2.h conflict with OpenSSL's breaking sk-dummy
174
243
CONFIGFLAGS=" ${CONFIGFLAGS} --without-hardening --disable-security-key"
175
244
;;
245
+ openwrt-* )
246
+ CONFIGFLAGS=" ${CONFIGFLAGS} --without-openssl --without-zlib"
247
+ TEST_TARGET=" t-exec"
248
+ ;;
176
249
sol10|sol11)
177
250
# sol10 VM is 32bit and the unit tests are slow.
178
251
# sol11 has 4 test configs so skip unit tests to speed up.
@@ -184,10 +257,13 @@ case "${TARGET_HOST}" in
184
257
;;
185
258
esac
186
259
187
- # Unless specified otherwise, build without OpenSSL on Mac OS since
188
- # modern versions don't ship with libcrypto.
189
260
case " ` ./config.guess` " in
261
+ * cygwin)
262
+ SUDO=" "
263
+ ;;
190
264
* -darwin* )
265
+ # Unless specified otherwise, build without OpenSSL on Mac OS since
266
+ # modern versions don't ship with libcrypto.
191
267
LIBCRYPTOFLAGS=" --without-openssl"
192
268
TEST_TARGET=t-exec
193
269
;;
@@ -210,5 +286,5 @@ if [ -x "$(which plink 2>/dev/null)" ]; then
210
286
export REGRESS_INTEROP_PUTTY
211
287
fi
212
288
213
- export CC CFLAGS LTESTS SUDO
289
+ export CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
214
290
export TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS TEST_SSH_FAIL_FATAL
0 commit comments