mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Doug Porter's patch that changes the order of preferences on how to find the
default netrc file. We now read and uses HOME _before_ we use getpwuid() to better allow users to move around HOME to use different .netrc files without having to rely on even blacker magic.
This commit is contained in:
parent
e7050f97c4
commit
c6e5b67197
10
lib/netrc.c
10
lib/netrc.c
@ -111,7 +111,12 @@ int Curl_parsenetrc(char *host,
|
||||
}
|
||||
#endif /* CURLDEBUG */
|
||||
if(!netrcfile) {
|
||||
home = curl_getenv("HOME"); /* portable environment reader */
|
||||
if(home) {
|
||||
home_alloc = TRUE;
|
||||
#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
|
||||
}
|
||||
else {
|
||||
struct passwd *pw;
|
||||
pw= getpwuid(geteuid());
|
||||
if (pw) {
|
||||
@ -122,13 +127,10 @@ int Curl_parsenetrc(char *host,
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!home) {
|
||||
home = curl_getenv("HOME"); /* portable environment reader */
|
||||
if(!home)
|
||||
return -1;
|
||||
home_alloc = TRUE;
|
||||
}
|
||||
|
||||
netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC);
|
||||
if(!netrcfile) {
|
||||
|
Loading…
Reference in New Issue
Block a user