Skip to content

netrc: remember and check filename loaded#21903

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:netrc-file-cache-checks
Closed

netrc: remember and check filename loaded#21903
icing wants to merge 3 commits into
curl:masterfrom
icing:netrc-file-cache-checks

Conversation

@icing

@icing icing commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Remember the filename of a loaded netrc file to detect changed configurations in a reused easy handle.

Remember the filename of a loaded netrc file to detect changed
configurations in a reused easy handle.
Comment thread lib/netrc.c
Comment thread lib/netrc.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates curl’s netrc caching so a reused easy handle can detect when a different netrc filename is being scanned and (re)load the file accordingly, rather than reusing previously loaded contents blindly.

Changes:

  • Clears the in-memory netrc buffer before (re)loading a netrc file.
  • Tracks the loaded netrc filename in store_netrc and reloads when the requested filename differs.
  • Initializes and frees the stored filename in Curl_netrc_init() / Curl_netrc_cleanup().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/netrc.c
Comment thread lib/netrc.c
Comment thread lib/netrc.c Outdated
Comment thread lib/netrc.c
@bagder bagder closed this in 435fb96 Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants