Bugzilla – Attachment 2519 Details for
Bug 2320
end-of-line comments work in sshd_config but not in ssh_config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Strip comments from ssh config files
ssh_config-comment.diff (text/plain), 878 bytes, created by
Damien Miller
on 2014-12-23 15:23:13 AEDT
(
hide
)
Description:
Strip comments from ssh config files
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2014-12-23 15:23:13 AEDT
Size:
878 bytes
patch
obsolete
>diff --git a/readconf.c b/readconf.c >index 399b73e..01d0918 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -1509,7 +1509,7 @@ read_config_file(const char *filename, struct passwd *pw, const char *host, > const char *original_host, Options *options, int flags) > { > FILE *f; >- char line[1024]; >+ char *cp, line[1024]; > int active, linenum; > int bad_options = 0; > >@@ -1537,6 +1537,11 @@ read_config_file(const char *filename, struct passwd *pw, const char *host, > while (fgets(line, sizeof(line), f)) { > /* Update line number counter. */ > linenum++; >+ if (strlen(line) == sizeof(line) - 1) >+ fatal("%s line %d too long", filename, linenum); >+ /* Trim out comments. */ >+ if ((cp = strchr(line, '#')) != NULL) >+ memcpy(cp, "\n", 2); > if (process_config_line(options, pw, host, original_host, > line, filename, linenum, &active, flags) != 0) > bad_options++;
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 2320
:
2519
|
3460