curl/tests/data/test2114
Stefan Eissing e0222c0029
test2114: fix reading from stdin
The test provides an invalid username, but no ':' with password, so that
the curl tool tries to read the password from stdin. That makes the test
hang, also in CI.

The check for invalid characters is happening when the CURLOPT_USERPWD
is applied to the URL, so when the transfer is started. Maybe the check
should happen also in setopt already.

The test hangs because tool_paramhlp.c:548 `checkpasswd()` does not see
a ':' and tries to read the password from stdin.

Fix: add a ':' in the tests invalid user setting, so that the read does
not happen.

Follow-up to ecaa344a7a

Closes #22264
2026-07-04 22:53:01 +02:00

43 lines
857 B
XML

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
# Server-side
<reply>
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
FTP username with embedded CRLF is rejected
</name>
# read the credentials from a config file so the raw CR LF reaches curl intact
# regardless of how the platform passes command line arguments
<file name="%LOGDIR/test%TESTNUMBER.config">
user = "anonymous\r\nSTOR: /%TESTNUMBER"
</file>
<command>
ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -K %LOGDIR/test%TESTNUMBER.config
</command>
</client>
# Verify data after the test has been "shot"
<verify>
# 43 - CURLE_BAD_FUNCTION_ARGUMENT
<errorcode>
43
</errorcode>
# the credentials are rejected before connecting so the injected STOR command
# must never reach the server
<protocol nonewline="yes">
</protocol>
</verify>
</testcase>