Bugzilla – Attachment 2647 Details for
Bug 1585
Allow an `Include' option which reads another config file in place and does not error out when `Include' file not readable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for ssh config
include.patch (text/plain), 2.88 KB, created by
Jakub Jelen
on 2015-06-10 19:15:05 AEST
(
hide
)
Description:
proposed patch for ssh config
Filename:
MIME Type:
Creator:
Jakub Jelen
Created:
2015-06-10 19:15:05 AEST
Size:
2.88 KB
patch
obsolete
>diff --git a/readconf.c b/readconf.c >index 47125ae..f55e019 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -149,7 +149,7 @@ typedef enum { > oAddressFamily, oGssAuthentication, oGssDelegateCreds, > oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, > oSendEnv, oControlPath, oControlMaster, oControlPersist, >- oHashKnownHosts, >+ oHashKnownHosts, oInclude, > oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, > oVisualHostKey, oUseRoaming, > oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass, >@@ -254,6 +254,7 @@ static struct { > { "controlmaster", oControlMaster }, > { "controlpersist", oControlPersist }, > { "hashknownhosts", oHashKnownHosts }, >+ { "include", oInclude }, > { "tunnel", oTunnel }, > { "tunneldevice", oTunnelDevice }, > { "localcommand", oLocalCommand }, >@@ -1356,6 +1357,29 @@ parse_int: > intptr = &options->visual_host_key; > goto parse_flag; > >+ case oInclude: >+ arg = strdelim(&s); >+ if (!arg || *arg == '\0') >+ fatal("%.200s line %d: Missing argument.", filename, linenum); >+ char *readfile = NULL; >+ int ret = 0, r, i; >+ glob_t gbuf; >+ readfile = tilde_expand_filename(arg, getuid()); >+ glob(readfile, 0, NULL, &gbuf); >+ for (i = 0; i < gbuf.gl_pathc; i++) { >+ debug3("%.200s line %s: Including configuration file %s", >+ filename, linenum, gbuf.gl_pathv[i]); >+ r = read_config_file(gbuf.gl_pathv[i], pw, host, >+ original_host, options, 1); >+ // non-existing files are not returned from glob >+ ret = ret || (r != 1); >+ } >+ globfree(&gbuf); >+ free(readfile); >+ if (ret) >+ return ret; >+ break; >+ > case oIPQoS: > arg = strdelim(&s); > if ((value = parse_ipqos(arg)) == -1) >diff --git a/ssh.1 b/ssh.1 >index df7ac86..ef812b3 100644 >--- a/ssh.1 >+++ b/ssh.1 >@@ -451,6 +451,7 @@ For full details of the options listed below, and their possible values, see > .It HostName > .It IdentityFile > .It IdentitiesOnly >+.It Include > .It IPQoS > .It KbdInteractiveAuthentication > .It KbdInteractiveDevices >diff --git a/ssh_config.5 b/ssh_config.5 >index 268a627..018f317 100644 >--- a/ssh_config.5 >+++ b/ssh_config.5 >@@ -915,6 +915,30 @@ It is recommended that > .Cm IgnoreUnknown > be listed early in the configuration file as it will not be applied > to unknown options that appear before it. >+.It Cm Include >+Read the specified files as if their contents were pasted here. >+Files of the form >+.Dq ~/path/to/config >+will expand to >+.Dq $HOME/path/to/config >+where >+.Dq $HOME >+is the user's home directoy. >+Files of the form >+.Dq ~username/path/to/config >+will expand to >+.Dq $HOME/path/to/config >+where >+.Dq $HOME >+is >+.Dq username >+\'s home directory. >+A single >+.Dq ~ >+will not expand at all. >+Bad error counts are unique to each configuration file. >+Additionally you can specify wildcard character to include all matching >+files, for exanple "~/.ssh/conf.d/*.conf". > .It Cm IPQoS > Specifies the IPv4 type-of-service or DSCP class for connections. > Accepted values are
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 1585
:
1623
|
2274
|
2647
|
2790
|
2859