]> granicus.if.org Git - curl/commitdiff
netrc: support 'default' token
authorViktor Szakats <vszakats@users.noreply.github.com>
Thu, 9 Apr 2015 01:46:15 +0000 (03:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Apr 2015 21:57:37 +0000 (23:57 +0200)
The 'default' token has no argument and means to match _any_ domain.
It must be placed last if there are 'machine <name>' tokens in the same file.

See full description here:
https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html

lib/netrc.c

index 6271a3a2fe00a8af6f5da0e19dc9594c459b889e..e656cf7c6d99642ea95399b9d92f7ca4c35ec706 100644 (file)
@@ -137,6 +137,10 @@ int Curl_parsenetrc(const char *host,
                'password'. */
             state=HOSTFOUND;
           }
+          else if(Curl_raw_equal("default", tok)) {
+            state=HOSTVALID;
+            retcode=0; /* we did find our host */
+          }
           break;
         case HOSTFOUND:
           if(Curl_raw_equal(host, tok)) {