Debian Codegraph @

debian/tests/bad-configs

raw
1 #!/bin/sh
2
3 set -e
4 set -x
5
6 # Test that some bad libgssglue configurations are rejected properly.
7 # This also test that the binary is actually linked to libgssglue and
8 # not directly to the GSS-API library.
9
10 export LC_ALL=C
11
12 : ${GSASL=/usr/bin/gsasl}
13
14 CMD="$GSASL --service imap --hostname foobar --client -m GSSAPI"
15
16 # First test that tool works and there are no libgssglue errors in the
17 # default setup.
18
19 $CMD 2>&1 | grep gss_init_sec_context
20 $CMD 2>&1 | (! grep -e "^warning" -e "^can't open")
21
22 # Check that the GSSAPI_MECH_CONF environment variable is respected
23 # and leads to error message about missing library.
24
25 echo 'libfoobarbaz.so.3 mechglue_internal_krb5_init' > my_gssapi_mech.conf
26 GSSAPI_MECH_CONF=my_gssapi_mech.conf \
27 $CMD 2>&1 | grep "^can't open libfoobarbaz.so.3"
28
29 # Check that non-GSSAPI usage of the tool does not trigger libgssglue
30 # warnings.
31 GSSAPI_MECH_CONF=my_gssapi_mech.conf \
32 $GSASL --client-mechanisms 2>&1 | (! grep "^can't open libfoobarbaz.so.3")
33
34 rm -f my_gssapi_mech.conf
35
36 exit 0