Bugzilla – Attachment 2520 Details for
Bug 2329
Authorized keys environment parsing error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Untested patch, but should work
sshd.patch (text/plain), 2.60 KB, created by
coladict
on 2014-12-24 08:43:29 AEDT
(
hide
)
Description:
Untested patch, but should work
Filename:
MIME Type:
Creator:
coladict
Created:
2014-12-24 08:43:29 AEDT
Size:
2.60 KB
patch
obsolete
>Index: src/usr.bin/ssh/auth-options.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/auth-options.c,v >retrieving revision 1.64 >diff -u -r1.64 auth-options.c >--- src/usr.bin/ssh/auth-options.c 15 Jul 2014 15:54:14 -0000 1.64 >+++ src/usr.bin/ssh/auth-options.c 23 Dec 2014 21:19:52 -0000 >@@ -203,40 +203,58 @@ > goto next_option; > } > cp = "environment=\""; >- if (options.permit_user_env && >- strncasecmp(opts, cp, strlen(cp)) == 0) { >- char *s; >- struct envstring *new_envstring; >+ if (strncasecmp(opts, cp, strlen(cp)) == 0) { >+ if (options.permit_user_env) { >+ char *s; >+ struct envstring *new_envstring; > >- opts += strlen(cp); >- s = xmalloc(strlen(opts) + 1); >- i = 0; >- while (*opts) { >- if (*opts == '"') >- break; >- if (*opts == '\\' && opts[1] == '"') { >- opts += 2; >- s[i++] = '"'; >- continue; >+ opts += strlen(cp); >+ s = xmalloc(strlen(opts) + 1); >+ i = 0; >+ while (*opts) { >+ if (*opts == '"') >+ break; >+ if (*opts == '\\' && opts[1] == '"') { >+ opts += 2; >+ s[i++] = '"'; >+ continue; >+ } >+ s[i++] = *opts++; > } >- s[i++] = *opts++; >+ if (!*opts) { >+ debug("%.100s, line %lu: missing end quote", >+ file, linenum); >+ auth_debug_add("%.100s, line %lu: missing end quote", >+ file, linenum); >+ free(s); >+ goto bad_option; >+ } >+ s[i] = '\0'; >+ auth_debug_add("Adding to environment: %.900s", s); >+ debug("Adding to environment: %.900s", s); >+ new_envstring = xcalloc(1, sizeof(struct envstring)); >+ new_envstring->s = s; >+ new_envstring->next = custom_environment; >+ custom_environment = new_envstring; > } >- if (!*opts) { >- debug("%.100s, line %lu: missing end quote", >- file, linenum); >- auth_debug_add("%.100s, line %lu: missing end quote", >- file, linenum); >- free(s); >- goto bad_option; >+ else { >+ while (*opts) { >+ if (*opts == '"') >+ break; >+ if (*opts == '\\' && opts[1] == '"') { >+ opts += 2; >+ continue; >+ } >+ } >+ if (!*opts) { >+ debug("%.100s, line %lu: missing end quote", >+ file, linenum); >+ auth_debug_add("%.100s, line %lu: missing end quote", >+ file, linenum); >+ goto bad_option; >+ } > } >- s[i] = '\0'; >- auth_debug_add("Adding to environment: %.900s", s); >- debug("Adding to environment: %.900s", s); > opts++; >- new_envstring = xcalloc(1, sizeof(struct envstring)); >- new_envstring->s = s; >- new_envstring->next = custom_environment; >- custom_environment = new_envstring; > goto next_option; > } > cp = "from=\"";
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 2329
:
2520
|
2592