wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Accept "user" as an alias for "login" in .netrc


From: Tim Rühsen
Subject: Re: [PATCH] Accept "user" as an alias for "login" in .netrc
Date: Sun, 26 Nov 2023 19:12:35 +0100
User-agent: Mozilla Thunderbird

Hi Gerald,

On 11/25/23 21:34, Gerald Pfeifer wrote:
On one of my system I have been getting warnings like

   wget: .../.netrc:2: unknown token "user"
   wget: .../.netrc:2: unknown token "..."
   wget: .../.netrc:8: unknown token "user"
   wget: .../.netrc:8: unknown token "..."
   wget: .../.netrc:15: unknown token "user"
   wget: .../.netrc:15: unknown token "..."

for quite a while (where those entries were used by formail among others).

Digging into this a bit, into the wget sources, I found that wget solely
accepts "login" to specify usernames in .netrc.

This patch makes wget more flexible to also accept "user", like fetchmail
does, and hence silences those warnings.


(I hope providing a patch like this is okay?)

Thanks,
Gerald


2023-11-25  Gerald Pfeifer  <gerald@pfeifer.com>

        * src/netrc.c (parse_netrc_fp): Accept "user" as an alias
        for "login".

---
  src/netrc.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/src/netrc.c b/src/netrc.c
index a9232ed4..214e3cef 100644
--- a/src/netrc.c
+++ b/src/netrc.c
@@ -391,6 +391,10 @@ parse_netrc_fp (const char *path, FILE *fp)
                else if (!strcmp (tok, "login"))
                  last_token = tok_login;
+ /* "user" sometimes serves as an alias for "login". */
+              else if (!strcmp (tok, "user"))
+                last_token = tok_login;
+
                else if (!strcmp (tok, "macdef"))
                  last_token = tok_macdef;

Thanks for the patch.

I took a look into the fetchmail sources and also found "passwd" to be an alias for "password". Now we have both aliases supported, "user" and "passwd".

You are mentioned in the commit as "Reported-by".

Wget2 now also supports these two aliases.

Regards, Tim

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]