You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
curl_get_line: return error on ferror()
curl_get_line: return error on ferror()
curl_get_line: return error on ferror()
curl_get_line: fix potential infinite loop when filename is a directory
curl_get_line: fix potential infinite loop when filename is a directory