Bugzilla – Attachment 1610 Details for
Bug 866
ssh(1) is too picky about unknown options in ~/.ssh/config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch which allows OpenSSH to ignore unknown options.
openssh-ignore-unknown-options.patch (text/plain), 1.82 KB, created by
Olav Morken
on 2009-03-09 06:21:16 AEDT
(
hide
)
Description:
Patch which allows OpenSSH to ignore unknown options.
Filename:
MIME Type:
Creator:
Olav Morken
Created:
2009-03-09 06:21:16 AEDT
Size:
1.82 KB
patch
obsolete
>diff --git a/readconf.c b/readconf.c >index 53fc6c7..59003cc 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -131,7 +131,7 @@ typedef enum { > oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, > oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, > oVisualHostKey, oZeroKnowledgePasswordAuthentication, >- oDeprecated, oUnsupported >+ oDeprecated, oUnsupported, oIgnored > } OpCodes; > > /* Textual representations of the tokens. */ >@@ -310,11 +310,21 @@ static OpCodes > parse_token(const char *cp, const char *filename, int linenum) > { > u_int i; >+ int ignoreunknown; >+ >+ if (cp[0] == '@') { >+ ignoreunknown = 1; >+ cp = &cp[1]; >+ } else >+ ignoreunknown = 0; > > for (i = 0; keywords[i].name; i++) > if (strcasecmp(cp, keywords[i].name) == 0) > return keywords[i].opcode; > >+ if (ignoreunknown) >+ return oIgnored; >+ > error("%s: line %d: Bad configuration option: %s", > filename, linenum, cp); > return oBadOption; >@@ -923,6 +933,10 @@ parse_int: > error("%s line %d: Unsupported option \"%s\"", > filename, linenum, keyword); > return 0; >+ case oIgnored: >+ debug("%s line %d: Ignored option \"%s\"", >+ filename, linenum, keyword); >+ return 0; > > default: > fatal("process_config_line: Unimplemented opcode %d", opcode); >diff --git a/ssh_config.5 b/ssh_config.5 >index ea9a20b..9e7448d 100644 >--- a/ssh_config.5 >+++ b/ssh_config.5 >@@ -94,6 +94,12 @@ Arguments may optionally be enclosed in double quotes > .Pq \&" > in order to represent arguments containing spaces. > .Pp >+Keywords in the configuration file can be prefixed with >+.Ql @ >+to mark them as optional. >+This causes them to be silently ignored if they are unknown. >+The normal behaviour is to exit with an error on unknown options. >+.Pp > The possible > keywords and their meanings are as follows (note that > keywords are case-insensitive and arguments are case-sensitive):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 866
:
1610
|
2252