diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index a909db97fa07..d0e3e7a61a64 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -3,6 +3,7 @@ , c-aresSupport ? false, c-ares ? null , gnutlsSupport ? false, gnutls ? null , gsaslSupport ? false, gsasl ? null +, patchNetrcRegression ? false , gssSupport ? with stdenv.hostPlatform; ( !isWindows && # disable gss becuase of: undefined reference to `k5_bcmp' @@ -77,7 +78,7 @@ stdenv.mkDerivation rec { # quiche: support ca-fallback # https://github.com/curl/curl/commit/fdb5e21b4dd171a96cf7c002ee77bb08f8e58021 ./7.83.1-quiche-support-ca-fallback.patch - ]; + ] ++ lib.optional patchNetrcRegression ./netrc-regression.patch; outputs = [ "bin" "dev" "out" "man" "devdoc" ]; separateDebugInfo = stdenv.isLinux; diff --git a/pkgs/tools/networking/curl/netrc-regression.patch b/pkgs/tools/networking/curl/netrc-regression.patch new file mode 100644 index 000000000000..90ad3e52d1a2 --- /dev/null +++ b/pkgs/tools/networking/curl/netrc-regression.patch @@ -0,0 +1,16 @@ +diff --git a/lib/url.c b/lib/url.c +index a56e4b0..9f29593 100644 +--- a/lib/url.c ++++ b/lib/url.c +@@ -2971,6 +2971,12 @@ static CURLcode override_login(struct Curl_easy *data, + /* don't update the user name below */ + userp = NULL; + } ++ /* no user was set but a password, set a blank user */ ++ if(userp && !*userp && passwdp && *passwdp) { ++ *userp = strdup(""); ++ if(!*userp) ++ return CURLE_OUT_OF_MEMORY; ++ } + } + #endif diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index 1cf2beb2bbb5..25684ef3a7ae 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -1,6 +1,7 @@ { lib, fetchFromGitHub , version , suffix ? "" +, curl , sha256 ? null , src ? fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = version; inherit sha256; } , patches ? [ ] @@ -23,7 +24,6 @@ in , bzip2 , callPackage , coreutils -, curl , editline , flex , gnutar diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 1d2928f3ad6e..adbbfeff4851 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -1,6 +1,7 @@ { lib , aws-sdk-cpp , boehmgc +, curl , callPackage , fetchFromGitHub , fetchurl @@ -31,7 +32,7 @@ let common = args: callPackage - (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) + (import ./common.nix ({ inherit lib fetchFromGitHub curl; } // args)) { inherit Security storeDir stateDir confDir; boehmgc = boehmgc-nix; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ceacfe402229..e151dbeffa2d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34176,6 +34176,7 @@ with pkgs; storeDir = config.nix.storeDir or "/nix/store"; stateDir = config.nix.stateDir or "/nix/var"; inherit (darwin.apple_sdk.frameworks) Security; + curl = curl.override { patchNetrcRegression = true; }; }); nix = nixVersions.stable;