I did this
Our code is calling curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "/") instead of "" for hysterical raisins. While obviously problematic, I am not certain that it is forbidden? CURLOPT_COOKIEFILE(3) states that specifying a non-existent file, while not a good idea, should work identically to "". And, well, one could argue that the “file” / does not, strictly speaking, exist. (I admit this may be a bit of a stretch.)
Anyways, when we upgraded from 8.14 to 8.18 our code started hanging. Root cause appears to be curl_get_line: enhance the API. The crux is that fopen() on a directory works, even though fgets() will always fail — yet feof() always returns 0. (At least on my Linux box.)
I expected the following
It definitely shouldn't hang. I would prefer that setting a CURLOPT_COOKIEFILE="/" be treated equivalent to "", but in light of the whole purpose of 769ccb4 being to tighten up error handling, I could be persuaded that perhaps an error should now be returned. (EDIT: we've all agreed that the correct behavior is for directories to error out.)
curl/libcurl version
Regression observed in curl 8.18.0 versus 8.14.1
operating system
Observed both on Arch Linux and on a Yocto variant.
I did this
Our code is calling
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "/")instead of""for hysterical raisins. While obviously problematic, I am not certain that it is forbidden? CURLOPT_COOKIEFILE(3) states that specifying a non-existent file, while not a good idea, should work identically to"". And, well, one could argue that the “file”/does not, strictly speaking, exist. (I admit this may be a bit of a stretch.)Anyways, when we upgraded from 8.14 to 8.18 our code started hanging. Root cause appears to be curl_get_line: enhance the API. The crux is that
fopen()on a directory works, even thoughfgets()will always fail — yetfeof()always returns 0. (At least on my Linux box.)I expected the following
It definitely shouldn't hang.
I would prefer that setting ain light of the whole purpose of 769ccb4 being to tighten up error handling, I could be persuaded that perhaps an error should now be returned. (EDIT: we've all agreed that the correct behavior is for directories to error out.)CURLOPT_COOKIEFILE="/"be treated equivalent to"", butcurl/libcurl version
Regression observed in curl 8.18.0 versus 8.14.1
operating system
Observed both on Arch Linux and on a Yocto variant.