diff options
Diffstat (limited to 'src/netrc.c')
-rw-r--r-- | src/netrc.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/netrc.c b/src/netrc.c index 47fe9b0..6375b66 100644 --- a/src/netrc.c +++ b/src/netrc.c @@ -235,7 +235,7 @@ parse_netrc (const char *path) /* The latest token we've seen in the file. */ enum { - tok_nothing, tok_account, tok_login, tok_macdef, tok_machine, tok_password + tok_nothing, tok_account, tok_login, tok_macdef, tok_machine, tok_password, tok_port, tok_force } last_token = tok_nothing; current = retval = NULL; @@ -344,6 +344,18 @@ parse_netrc (const char *path) premature_token = "account"; break; + /* We don't handle the port keyword at all. */ + case tok_port: + if (!current) + premature_token = "port"; + break; + + /* We don't handle the force keyword at all. */ + case tok_force: + if (!current) + premature_token = "force"; + break; + /* We handle tok_nothing below this switch. */ case tok_nothing: break; @@ -365,10 +377,10 @@ parse_netrc (const char *path) /* Fetch the next token. */ if (!strcmp (tok, "account")) last_token = tok_account; + else if (!strcmp (tok, "default")) - { maybe_add_to_list (¤t, &retval); - } + else if (!strcmp (tok, "login")) last_token = tok_login; @@ -381,6 +393,16 @@ parse_netrc (const char *path) else if (!strcmp (tok, "password")) last_token = tok_password; + /* GNU extensions 'port' and 'force', not operational + * see https://www.gnu.org/software/emacs/manual/html_node/gnus/NNTP.html#index-nntp_002dauthinfo_002dfunction-2003 + * see https://savannah.gnu.org/bugs/index.php?52066 + */ + else if (!strcmp (tok, "port")) + last_token = tok_port; + + else if (!strcmp (tok, "force")) + last_token = tok_force; + else fprintf (stderr, _("%s: %s:%d: unknown token \"%s\"\n"), exec_name, path, ln, tok); |