Bugzilla – Attachment 3138 Details for
Bug 1285
provide fallback options /etc/ssh/ssh_config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
SendEnv -PATTERN
bz1285.diff (text/plain), 2.17 KB, created by
Damien Miller
on 2018-04-06 15:30:47 AEST
(
hide
)
Description:
SendEnv -PATTERN
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2018-04-06 15:30:47 AEST
Size:
2.17 KB
patch
obsolete
>diff --git a/readconf.c b/readconf.c >index ae1c31da..e539c05e 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -684,6 +684,40 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, > return result; > } > >+/* Remove environment variable by pattern */ >+static void >+rm_env(Options *options, const char *arg, const char *filename, int linenum) >+{ >+ int i, j; >+ char *cp; >+ >+ /* Remove an environment variable */ >+ for (i = 0; i < options->num_send_env; ) { >+ cp = xstrdup(options->send_env[i]); >+ if (strchr(cp, '=') != NULL) { >+ fatal("%s line %d: environment variable to " >+ "remove contains '='", filename, linenum) >+ } >+ cp[strcspn(cp, "=")] = '\0'; >+ if (!match_pattern(cp, arg + 1)) { >+ free(cp); >+ i++; >+ continue; >+ } >+ debug3("%s line %d: removing environment %s", >+ filename, linenum, cp); >+ free(cp); >+ free(options->send_env[i]); >+ options->send_env[i] = NULL; >+ for (j = i; j < options->num_send_env - 1; j++) { >+ options->send_env[j] = options->send_env[j + 1]; >+ options->send_env[j + 1] = NULL; >+ } >+ options->num_send_env--; >+ /* NB. don't increment i */ >+ } >+} >+ > /* > * Returns the number of the token pointed to by cp or oBadOption. > */ >@@ -1354,6 +1388,12 @@ parse_keytypes: > > case oSendEnv: > while ((arg = strdelim(&s)) != NULL && *arg != '\0') { >+ if (*arg == '-') { >+ /* Removing an env var */ >+ rm_env(options, arg, filename, linenum); >+ continue; >+ } >+ /* Adding an env var */ > if (strchr(arg, '=') != NULL) > fatal("%s line %d: Invalid environment name.", > filename, linenum); >diff --git a/ssh_config.5 b/ssh_config.5 >index 75a21b59..d9d26e87 100644 >--- a/ssh_config.5 >+++ b/ssh_config.5 >@@ -1394,11 +1394,16 @@ Multiple environment variables may be separated by whitespace or spread > across multiple > .Cm SendEnv > directives. >+.Pp >+See >+.Sx PATTERNS >+for more information on patterns. >+.Pp >+It is possible to clear previously-set >+.Cm SendEnv >+variable names by prefixing patterns with >+.Pa - . > The default is not to send any environment variables. >-.Pp >-See >-.Sx PATTERNS >-for more information on patterns. > .It Cm ServerAliveCountMax > Sets the number of server alive messages (see below) which may be > sent without
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 1285
:
2336
|
2375
|
3138
|
3139