summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pazdziora <jpazdziora@redhat.com>2022-01-30 13:39:23 +0100
committerJan Pazdziora <jpazdziora@redhat.com>2022-01-30 13:51:48 +0100
commita01498b6b920cd7576535bd1974732c839408bc6 (patch)
treec3471ef57964fce7b1e9e3f4a7a89a9487648ca5
parent63ba10a28d98f5679ef7f0b948f777533e9ee455 (diff)
downloadmod_intercept_form_submit-a01498b6b920cd7576535bd1974732c839408bc6.tar.gz
mod_intercept_form_submit-a01498b6b920cd7576535bd1974732c839408bc6.tar.xz
mod_intercept_form_submit-a01498b6b920cd7576535bd1974732c839408bc6.zip
Test input encoding handling.
-rwxr-xr-xtests/config.sh2
-rwxr-xr-xtests/run.sh4
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/config.sh b/tests/config.sh
index 3f949b6..3f304c8 100755
--- a/tests/config.sh
+++ b/tests/config.sh
@@ -10,5 +10,7 @@ chmod a+x /var/log/httpd
cp tests/auth.conf /etc/httpd/conf.d/
useradd user1
echo user1:heslo1 | chpasswd
+useradd --badname liška
+echo 'liška:myši & zajíci' | chpasswd
chgrp apache /etc/shadow
chmod g+r /etc/shadow
diff --git a/tests/run.sh b/tests/run.sh
index 5360791..5d394fc 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -16,6 +16,8 @@ curl -u userx:heslox -s http://localhost/auth1 | tee /dev/stderr | grep -F 'REMO
curl --data '' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]'
curl --data 'login=user1&password=heslox' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]'
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=heslo1' | wc -l | grep -q 2
+curl --data 'login=li%C5%A1ka&password=myši+& zaj%c3%adci' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]'
+curl --data 'login=li%C5%A1ka&password=myši %26%20zaj%c3%adci' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[liška]' -e 'login=li%C5%A1ka&password=myši %26%20zaj%c3%adci' | wc -l | grep -q 2
curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=heslo1&something=else&login=user1' | wc -l | grep -q 2
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=[REDACTED]' | wc -l | grep -q 2
curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=[REDACTED]&something=else&login=user1' | wc -l | grep -q 2
@@ -25,5 +27,7 @@ curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si
chage -d $(date -d -2days +%Y-%m-%d) -M 1 user1
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=user1' | wc -l | grep -q 2
curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=user1' | wc -l | grep -q 2
+chage -d $(date -d -2days +%Y-%m-%d) -M 1 'liška'
+curl --data 'something=somewhere&password=myši+%26%20zaj%C3%adci&something=else&login=liška' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=li%c5%a1ka' | wc -l | grep -q 2
echo OK $0.