mirror of
https://github.com/curl/curl.git
synced 2025-09-18 01:52:41 +03:00
tool_getparam: error out on missing -K file
Add test 411 to verify. Reported-by: Median Median Stride Bug: https://hackerone.com/reports/1542881 Closes #8731
This commit is contained in:
parent
ca94497a82
commit
a09a12806e
|
@ -1948,9 +1948,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||||
config->insecure_ok = toggle;
|
config->insecure_ok = toggle;
|
||||||
break;
|
break;
|
||||||
case 'K': /* parse config file */
|
case 'K': /* parse config file */
|
||||||
if(parseconfig(nextarg, global))
|
if(parseconfig(nextarg, global)) {
|
||||||
warnf(global, "error trying read config from the '%s' file\n",
|
errorf(global, "cannot read config from '%s'\n", nextarg);
|
||||||
nextarg);
|
return PARAM_READ_ERROR;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
config->dirlistonly = toggle; /* only list the names of the FTP dir */
|
config->dirlistonly = toggle; /* only list the names of the FTP dir */
|
||||||
|
|
|
@ -68,7 +68,7 @@ test380 test381 test383 test384 test385 test386 \
|
||||||
test392 test393 test394 test395 test396 test397 test398 \
|
test392 test393 test394 test395 test396 test397 test398 \
|
||||||
\
|
\
|
||||||
test400 test401 test402 test403 test404 test405 test406 test407 test408 \
|
test400 test401 test402 test403 test404 test405 test406 test407 test408 \
|
||||||
test409 test410 \
|
test409 test410 test411 \
|
||||||
\
|
\
|
||||||
test430 test431 test432 test433 test434 test435 test436 \
|
test430 test431 test432 test433 test434 test435 test436 \
|
||||||
\
|
\
|
||||||
|
|
43
tests/data/test411
Normal file
43
tests/data/test411
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
-K
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
none
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
-K with missing file causes error
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
-K log/missing http://localhost
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<stderr mode="text">
|
||||||
|
curl: cannot read config from 'log/missing'
|
||||||
|
curl: option -K: error encountered when reading a file
|
||||||
|
%if manual
|
||||||
|
curl: try 'curl --help' or 'curl --manual' for more information
|
||||||
|
%else
|
||||||
|
curl: try 'curl --help' for more information
|
||||||
|
%endif
|
||||||
|
</stderr>
|
||||||
|
<errorcode>
|
||||||
|
26
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
Loading…
Reference in New Issue
Block a user