Debian Codegraph @

debian/tests/bad-configs-root

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 cp /etc/gssapi_mech.conf /etc/gssapi_mech.conf-backup
26
27 echo 'libbarfoobaz.so.3 mechglue_internal_krb5_init' > /etc/gssapi_mech.conf
28 $CMD 2>&1 | grep "^can't open libbarfoobaz.so.3"
29
30 # Check that non-GSSAPI usage of the tool does not trigger libgssglue
31 # warnings.
32 $GSASL --client-mechanisms 2>&1 | (! grep "^can't open libbarfoobaz.so.3")
33
34 # Check that the GSSAPI_MECH_CONF environment variable is respected
35 # and overrides /etc/gssapi_mech.conf and leads to error message about
36 # missing library.
37
38 echo 'libfoobarbaz.so.3 mechglue_internal_krb5_init' > my_gssapi_mech.conf
39 GSSAPI_MECH_CONF=my_gssapi_mech.conf \
40 $CMD 2>&1 | grep "^can't open libfoobarbaz.so.3"
41
42 # Check that non-GSSAPI usage of the tool does not trigger libgssglue
43 # warnings.
44 GSSAPI_MECH_CONF=my_gssapi_mech.conf \
45 $GSASL --client-mechanisms 2>&1 | (! grep "^can't open libfoobarbaz.so.3")
46
47 mv /etc/gssapi_mech.conf-backup /etc/gssapi_mech.conf
48 rm -f my_gssapi_mech.conf
49
50 exit 0