Bugzilla – Attachment 3564 Details for
Bug 3379
Config parser only allows SetEnv once
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
working proof of concept patch
setenv.patch (text/plain), 1.22 KB, created by
Florian Streibelt
on 2022-01-11 11:38:19 AEDT
(
hide
)
Description:
working proof of concept patch
Filename:
MIME Type:
Creator:
Florian Streibelt
Created:
2022-01-11 11:38:19 AEDT
Size:
1.22 KB
patch
obsolete
>--- openssh-8.8p1/readconf.c 2021-09-26 16:03:19.000000000 +0200 >+++ openssh-8.8p1.patched/readconf.c 2022-01-11 01:35:05.953723369 +0100 >@@ -1746,15 +1746,29 @@ > break; > > case oSetEnv: >- value = options->num_setenv; > while ((arg = argv_next(&ac, &av)) != NULL) { > if (strchr(arg, '=') == NULL) { > error("%s line %d: Invalid SetEnv.", > filename, linenum); > goto out; > } >- if (!*activep || value != 0) >+ if (!*activep) > continue; >+ >+ /* Update existing setenv var */ >+ size_t envlen = strchr(arg, '=') - arg; >+ for (int i = 0; i < options->num_setenv; i++) { >+ if (strncmp(options->setenv[i], arg, envlen) == 0 ){ >+ debug("%.200s line %d: Updating SetEnv " >+ "from %s to %s " >+ , filename, linenum, >+ options->setenv[i], arg); >+ free(options->setenv[i]); >+ options->setenv[i] = xstrdup(arg); >+ goto no_new_env; >+ } >+ } >+ > /* Adding a setenv var */ > if (options->num_setenv >= INT_MAX) { > error("%s line %d: too many SetEnv.", >@@ -1765,6 +1779,9 @@ > options->setenv, options->num_setenv, > options->num_setenv + 1, sizeof(*options->setenv)); > options->setenv[options->num_setenv++] = xstrdup(arg); >+ >+ no_new_env: >+ > } > break; >
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 3379
: 3564