FreeBSD Bugzilla – Attachment 175355 Details for
Bug 207117
mail/ssmtp: Config file is parsed incorrectly if '#' character is part of an option value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
a patch to the existing FreeBSD patch
patch-patch-ssmtp.c (text/plain), 5.49 KB, created by
Sergey Manucharian
on 2016-10-02 04:51:06 UTC
(
hide
)
Description:
a patch to the existing FreeBSD patch
Filename:
MIME Type:
Creator:
Sergey Manucharian
Created:
2016-10-02 04:51:06 UTC
Size:
5.49 KB
patch
obsolete
>--- patch-ssmtp.c.org 2016-10-01 21:59:46.584687000 -0600 >+++ patch-ssmtp.c 2016-10-01 22:38:58.805824000 -0600 >@@ -1,5 +1,5 @@ >---- ssmtp.c.orig 2009-11-23 11:55:11.000000000 +0200 >-+++ ssmtp.c 2011-02-21 02:56:10.000000000 +0200 >+--- ssmtp.c.orig 2009-11-23 11:55:11.000000000 +0200 >++++ ssmtp.c 2011-02-21 02:56:10.000000000 +0200 > @@ -25,6 +25,7 @@ > #include <string.h> > #include <ctype.h> >@@ -120,7 +120,7 @@ > } > > /* Ignore malformed lines and comments */ >-@@ -519,11 +543,11 @@ >+@@ -519,11 +538,11 @@ > #endif > > /* Ignore missing usernames */ >@@ -134,7 +134,7 @@ > die("rcpt_save() -- strdup() failed"); > } > >-@@ -548,7 +572,7 @@ >+@@ -548,7 +567,7 @@ > (void)fprintf(stderr, "*** rcpt_parse(): str = [%s]\n", str); > #endif > >@@ -143,7 +143,7 @@ > die("rcpt_parse(): strdup() failed"); > } > q = p; >-@@ -576,7 +600,7 @@ >+@@ -576,7 +595,7 @@ > } > > /* End of string? */ >@@ -152,7 +152,7 @@ > got_addr = True; > } > >-@@ -584,7 +608,7 @@ >+@@ -584,7 +603,7 @@ > if((*q == ',') && (in_quotes == False)) { > got_addr = True; > >@@ -161,7 +161,7 @@ > } > > if(got_addr) { >-@@ -668,7 +692,7 @@ >+@@ -668,7 +687,7 @@ > (void)fprintf(stderr, "header_save(): str = [%s]\n", str); > #endif > >@@ -170,7 +170,7 @@ > die("header_save() -- strdup() failed"); > } > ht->string = p; >-@@ -676,7 +700,7 @@ >+@@ -676,7 +695,7 @@ > if(strncasecmp(ht->string, "From:", 5) == 0) { > #if 1 > /* Hack check for NULL From: line */ >@@ -179,7 +179,7 @@ > return; > } > #endif >-@@ -739,19 +763,19 @@ >+@@ -739,19 +758,19 @@ > void header_parse(FILE *stream) > { > size_t size = BUF_SZ, len = 0; >@@ -203,7 +203,7 @@ > die("header_parse() -- realloc() failed"); > } > q = (p + len); >-@@ -776,9 +800,9 @@ >+@@ -776,9 +795,9 @@ > in_header = False; > > default: >@@ -215,7 +215,7 @@ > } > header_save(p); > >-@@ -809,9 +833,9 @@ >+@@ -809,9 +828,9 @@ > in_header = False; > > default: >@@ -227,12 +227,18 @@ > } > header_save(p); > >-@@ -876,11 +900,11 @@ >+@@ -876,21 +895,27 @@ > char *rightside; > /* Make comments invisible */ > if((p = strchr(buf, '#'))) { > - *p = (char)NULL; >-+ *p = '\0'; >++ /* check if # is a part of a param */ >++ if((q = strchr(buf, '='))) { >++ if ((int)(p-buf) < (int)(q-buf)) >++ *p = '\0'; >++ } >++ else >++ *p = '\0'; > } > > /* Ignore malformed lines and comments */ >@@ -241,7 +247,10 @@ > > /* Parse out keywords */ > p=firsttok(&begin, "= \t\n"); >-@@ -890,7 +914,7 @@ >+ if(p){ >+ rightside=begin; >+- q = firsttok(&begin, "= \t\n"); >++ q = firsttok(&begin, " \t\n"); > } > if(p && q) { > if(strcasecmp(p, "Root") == 0) { >@@ -250,7 +259,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -904,7 +928,7 @@ >+@@ -904,7 +929,7 @@ > port = atoi(r); > } > >@@ -259,7 +268,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -949,7 +973,7 @@ >+@@ -949,7 +974,7 @@ > mail_domain = strdup(q); > } > >@@ -268,7 +277,7 @@ > die("parse_config() -- strdup() failed"); > } > rewrite_domain = True; >-@@ -1025,7 +1049,7 @@ >+@@ -1025,7 +1050,7 @@ > } > } > else if(strcasecmp(p, "TLSCert") == 0) { >@@ -277,7 +286,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -1036,7 +1060,7 @@ >+@@ -1036,7 +1061,7 @@ > #endif > /* Command-line overrides these */ > else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) { >@@ -286,7 +295,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -1045,7 +1069,7 @@ >+@@ -1045,7 +1070,7 @@ > } > } > else if(strcasecmp(p, "AuthPass") == 0 && !auth_pass) { >@@ -295,7 +304,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -1054,7 +1078,7 @@ >+@@ -1054,7 +1079,7 @@ > } > } > else if(strcasecmp(p, "AuthMethod") == 0 && !auth_method) { >@@ -304,7 +313,7 @@ > die("parse_config() -- strdup() failed"); > } > >-@@ -1107,11 +1131,11 @@ >+@@ -1107,11 +1132,11 @@ > #ifdef INET6 > struct addrinfo hints, *ai0, *ai; > char servname[NI_MAXSERV]; >@@ -318,7 +327,7 @@ > #endif > > #ifdef HAVE_SSL >-@@ -1310,7 +1334,7 @@ >+@@ -1310,7 +1335,7 @@ > buf[i++] = c; > } > } >@@ -327,7 +336,7 @@ > > return(buf); > } >-@@ -1434,14 +1458,14 @@ >+@@ -1435,14 +1460,14 @@ > } > > if((p = strtok(pw->pw_gecos, ";,"))) { >@@ -344,7 +353,7 @@ > uad = append_domain(pw->pw_name); > } > >-@@ -1489,7 +1513,7 @@ >+@@ -1490,7 +1515,7 @@ > /* Try to log in if username was supplied */ > if(auth_user) { > #ifdef MD5AUTH >@@ -353,7 +362,7 @@ > auth_pass = strdup(""); > } > >-@@ -1737,7 +1761,7 @@ >+@@ -1742,7 +1767,7 @@ > j = 0; > > add = 1; >@@ -362,7 +371,7 @@ > switch(argv[i][j]) { > #ifdef INET6 > case '6': >-@@ -1755,14 +1779,14 @@ >+@@ -1760,14 +1785,14 @@ > if((!argv[i][(j + 1)]) > && argv[(i + 1)]) { > auth_user = strdup(argv[i+1]); >@@ -379,7 +388,7 @@ > die("parse_options() -- strdup() failed"); > } > } >-@@ -1772,14 +1796,14 @@ >+@@ -1777,14 +1802,14 @@ > if((!argv[i][(j + 1)]) > && argv[(i + 1)]) { > auth_pass = strdup(argv[i+1]); >@@ -396,7 +405,7 @@ > die("parse_options() -- strdup() failed"); > } > } >-@@ -1870,14 +1894,14 @@ >+@@ -1875,14 +1900,14 @@ > case 'F': > if((!argv[i][(j + 1)]) && argv[(i + 1)]) { > minus_F = strdup(argv[(i + 1)]); >@@ -413,7 +422,7 @@ > die("parse_options() -- strdup() failed"); > } > } >-@@ -1889,14 +1913,14 @@ >+@@ -1894,14 +1919,14 @@ > case 'r': > if((!argv[i][(j + 1)]) && argv[(i + 1)]) { > minus_f = strdup(argv[(i + 1)]);
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 207117
:
166879
| 175355