-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl tool won't search for curlrc (no leading dot) in XDG_CONFIG_HOME #12129
Comments
-K, --config doc says it should be doing |
Other applications that put stuff in |
Well on further thought I think the ship has sailed so to speak, as it's likely that users are already using .curlrc in XDG_CONFIG_HOME since that's all that has worked, however we can add another ship for curlrc in XDG_CONFIG_HOME. It's too late now to recall it. Again I don't know why this wasn't done if it was a bug or what but I'm going to treat it as one and write up a PR |
I think it is a bug. |
WIP The order is now: - $XDG_CONFIG_HOME/curlrc - $XDG_CONFIG_HOME/.curlrc - $XDG_CONFIG_HOME/_curlrc (if dotscore is true) Fixes curl#12129 Closes #xxxx Prior to this change there was no check for the dotless version of the filename.
The order is now: - $XDG_CONFIG_HOME/curlrc - $XDG_CONFIG_HOME/.curlrc - $XDG_CONFIG_HOME/_curlrc (if dotscore is true) Prior to this change there was no check for the dotless version of the filename. Fixes curl#12129 Closes #xxxx
Hi everyone, I'm new to contributing to libcurl, and I'd like to work on this issue. I'll start investigating and update here with my progress. Any guidance or tips would be greatly appreciated. Thanks, |
@sukanto-earth I believe the core of this logic is in |
If XDG_CONFIG_HOME is set, look for XDG_CONFIG_HOME/curlrc - without a leading dot in the filename. Fixes #12129 Reported-by: Jat Satiro
If XDG_CONFIG_HOME is set, look for XDG_CONFIG_HOME/curlrc - without a leading dot in the filename. Fixes #12129 Reported-by: Jat Satiro
I did this
@b-jazz reported in #8208 (comment) that when curl is searching for the .curlrc file, it searches XDG_CONFIG_HOME for .curlrc but does not search it for curlrc (no leading dot).
The original reporter of #8208 reported that as well. When that issue was fixed by 764e4f0 it did not fix that part of the issue. Instead it was written in a specific way to not do that. findfile will search for curlrc (no leading dot) in $CURL_HOME/.config/curlrc and $HOME/.config/curlrc, but only if XDG_CONFIG_HOME is not set and .curlrc has not been found anywhere else.
Here's two typical setups and how curl currently behaves:
If CURL_HOME is not set, and XDG_CONFIG_HOME is set, and HOME is set, then the order is:
pw_dir
/.curlrcIf CURL_HOME is not set, and XDG_CONFIG_HOME is not set, and HOME is set, then the order is:
pw_dir
/.curlrcNote pw_dir is usually the same as $HOME.
Note for brevity I've excluded how we also search for _curlrc when .curlrc is not found, since that logic just complicates understanding this and AFAICT it's not relevant here.
I expected the following
I'm not sure if this is a bug or not since the commit was written specifically not to strip the dot from curlrc when checking XDG_CONFIG_HOME, and I can't figure from the discussion why it was done that way.
curl/libcurl version
curl 8.4.0
operating system
Linux
The text was updated successfully, but these errors were encountered: