Bugzilla – Attachment 2336 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]
Patch to address fallback options to SendEnv
openssh-6.3p1.SendEnv.patch (text/plain), 2.06 KB, created by
Flavio Poletti
on 2013-09-17 10:05:50 AEST
(
hide
)
Description:
Patch to address fallback options to SendEnv
Filename:
MIME Type:
Creator:
Flavio Poletti
Created:
2013-09-17 10:05:50 AEST
Size:
2.06 KB
patch
obsolete
>diff --git a/clientloop.c b/clientloop.c >index 7c1f8ab..2926990 100644 >--- a/clientloop.c >+++ b/clientloop.c >@@ -2135,13 +2135,10 @@ client_session2_setup(int id, int want_tty, int want_subsystem, > *val++ = '\0'; > > matched = 0; >- for (j = 0; j < options.num_send_env; j++) { >- if (match_pattern(name, options.send_env[j])) { >- matched = 1; >- break; >- } >+ for (j = 0; (! matched) && (j < options.num_send_env); j++) { >+ matched = match_possibly_negated_pattern(name, options.send_env[j]); > } >- if (!matched) { >+ if (matched <= 0) { /* accept only strictly positive matches */ > debug3("Ignored env %s", name); > free(name); > continue; >diff --git a/match.c b/match.c >index 7be7d2c..9e5dea6 100644 >--- a/match.c >+++ b/match.c >@@ -110,6 +110,31 @@ match_pattern(const char *s, const char *pattern) > } > > /* >+ * Tries to match the string against the pattern, possibly preceded by ! to >+ * indicate negation). Returns -1 if negation matches, 1 if there is >+ * a positive match, 0 if there is no match at all. >+ */ >+ >+int >+match_possibly_negated_pattern(const char *s, const char *pattern) >+{ >+ int retval_if_matched; >+ >+ /* inizialize retval_if_matched according to pattern negation, if any */ >+ retval_if_matched = 1; >+ if (*pattern == '!') { >+ retval_if_matched = -1; >+ /* eliminate negation character */ >+ pattern++; >+ } >+ >+ if (match_pattern(s, pattern)) { >+ return retval_if_matched; >+ } >+ return 0; >+} >+ >+/* > * Tries to match the string against the > * comma-separated sequence of subpatterns (each possibly preceded by ! to > * indicate negation). Returns -1 if negation matches, 1 if there is >diff --git a/match.h b/match.h >index 3d7f70f..18e4b8f 100644 >--- a/match.h >+++ b/match.h >@@ -15,6 +15,7 @@ > #define MATCH_H > > int match_pattern(const char *, const char *); >+int match_possibly_negated_pattern(const char *, const char *); > int match_pattern_list(const char *, const char *, u_int, int); > int match_hostname(const char *, const char *, u_int); > int match_host_and_ip(const char *, const char *, const char *);
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