Merge pull request #176974 from domenkozar/fix-nix-netrc

nix: patch curl netrc regression
This commit is contained in:
Domen Kožar 2022-06-09 11:14:18 -05:00 committed by GitHub
commit 395c8b9b02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 3 deletions

View file

@ -3,6 +3,7 @@
, c-aresSupport ? false, c-ares ? null , c-aresSupport ? false, c-ares ? null
, gnutlsSupport ? false, gnutls ? null , gnutlsSupport ? false, gnutls ? null
, gsaslSupport ? false, gsasl ? null , gsaslSupport ? false, gsasl ? null
, patchNetrcRegression ? false
, gssSupport ? with stdenv.hostPlatform; ( , gssSupport ? with stdenv.hostPlatform; (
!isWindows && !isWindows &&
# disable gss becuase of: undefined reference to `k5_bcmp' # disable gss becuase of: undefined reference to `k5_bcmp'
@ -77,7 +78,7 @@ stdenv.mkDerivation rec {
# quiche: support ca-fallback # quiche: support ca-fallback
# https://github.com/curl/curl/commit/fdb5e21b4dd171a96cf7c002ee77bb08f8e58021 # https://github.com/curl/curl/commit/fdb5e21b4dd171a96cf7c002ee77bb08f8e58021
./7.83.1-quiche-support-ca-fallback.patch ./7.83.1-quiche-support-ca-fallback.patch
]; ] ++ lib.optional patchNetrcRegression ./netrc-regression.patch;
outputs = [ "bin" "dev" "out" "man" "devdoc" ]; outputs = [ "bin" "dev" "out" "man" "devdoc" ];
separateDebugInfo = stdenv.isLinux; separateDebugInfo = stdenv.isLinux;

View file

@ -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

View file

@ -1,6 +1,7 @@
{ lib, fetchFromGitHub { lib, fetchFromGitHub
, version , version
, suffix ? "" , suffix ? ""
, curl
, sha256 ? null , sha256 ? null
, src ? fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = version; inherit sha256; } , src ? fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = version; inherit sha256; }
, patches ? [ ] , patches ? [ ]
@ -23,7 +24,6 @@ in
, bzip2 , bzip2
, callPackage , callPackage
, coreutils , coreutils
, curl
, editline , editline
, flex , flex
, gnutar , gnutar

View file

@ -1,6 +1,7 @@
{ lib { lib
, aws-sdk-cpp , aws-sdk-cpp
, boehmgc , boehmgc
, curl
, callPackage , callPackage
, fetchFromGitHub , fetchFromGitHub
, fetchurl , fetchurl
@ -31,7 +32,7 @@ let
common = args: common = args:
callPackage callPackage
(import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) (import ./common.nix ({ inherit lib fetchFromGitHub curl; } // args))
{ {
inherit Security storeDir stateDir confDir; inherit Security storeDir stateDir confDir;
boehmgc = boehmgc-nix; boehmgc = boehmgc-nix;

View file

@ -34176,6 +34176,7 @@ with pkgs;
storeDir = config.nix.storeDir or "/nix/store"; storeDir = config.nix.storeDir or "/nix/store";
stateDir = config.nix.stateDir or "/nix/var"; stateDir = config.nix.stateDir or "/nix/var";
inherit (darwin.apple_sdk.frameworks) Security; inherit (darwin.apple_sdk.frameworks) Security;
curl = curl.override { patchNetrcRegression = true; };
}); });
nix = nixVersions.stable; nix = nixVersions.stable;