mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
ocserv: added support for per-user split-dns directive
Resolves: #229 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
@@ -153,6 +153,10 @@ ipv4-dns = 192.168.5.1
|
||||
# The NBNS server (if any)
|
||||
#ipv4-nbns = 192.168.2.3
|
||||
|
||||
# The domains over which the provided DNS should be used. Use
|
||||
# multiple lines for multiple domains.
|
||||
split-dns = example.com
|
||||
|
||||
#ipv6-address =
|
||||
#ipv6-mask =
|
||||
#ipv6-dns =
|
||||
|
||||
@@ -83,7 +83,7 @@ echo -n "Checking if proper dns was sent... "
|
||||
|
||||
CONTENTS=`cat ${TMPFILE1}|grep "X-CSTP-DNS: 8.8.8.8"`
|
||||
if test -z "$CONTENTS";then
|
||||
cat ${TMPFILE1}
|
||||
cat ${TMPFILE1}|grep X-CSTP-DNS
|
||||
fail $PID "Expected DNS was not sent"
|
||||
fi
|
||||
|
||||
@@ -99,6 +99,26 @@ fi
|
||||
|
||||
echo ok
|
||||
|
||||
echo -n "Checking if split-dns has been sent... "
|
||||
|
||||
CONTENTS=`cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example6.com`
|
||||
if test -z "$CONTENTS";then
|
||||
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
|
||||
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS was not found"
|
||||
fi
|
||||
|
||||
echo ok
|
||||
|
||||
echo -n "Checking if split-dns has not been sent... "
|
||||
|
||||
cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example.com >/dev/null
|
||||
if test $? = 0;then
|
||||
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
|
||||
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS contained main config value"
|
||||
fi
|
||||
|
||||
echo ok
|
||||
|
||||
echo -n "Checking if user-specific DPD has been sent... "
|
||||
|
||||
CONTENTS=`cat ${TMPFILE1}|grep X-DTLS-DPD|grep 880`
|
||||
@@ -150,6 +170,16 @@ if test -z "$CONTENTS";then
|
||||
fail $PID "Temporary file contents are not correct; address was not the expected (10.9.)"
|
||||
fi
|
||||
|
||||
echo -n "Checking if main config split-dns has been sent... "
|
||||
|
||||
cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example.com >/dev/null
|
||||
if test $? != 0;then
|
||||
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
|
||||
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS did not contain main config value"
|
||||
fi
|
||||
|
||||
echo ok
|
||||
|
||||
|
||||
kill $kpid3
|
||||
rm -f ${TMPFILE1}
|
||||
|
||||
@@ -4,3 +4,5 @@ keepalive = 14400
|
||||
max-same-clients = 1
|
||||
dns = 8.8.8.8
|
||||
hostname = xxxx
|
||||
split-dns = example5.com
|
||||
split-dns = example6.com
|
||||
|
||||
Reference in New Issue
Block a user