jer 14/08/20 08:07:57 Modified: pktstat-1.8.5-smtp_line.patch Log: Just remove the offending lines instead. (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key A792A613)
Revision Changes Path 1.2 net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch?rev=1.2&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch?rev=1.2&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch?r1=1.1&r2=1.2 Index: pktstat-1.8.5-smtp_line.patch =================================================================== RCS file: /var/cvsroot/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- pktstat-1.8.5-smtp_line.patch 20 Aug 2014 08:02:09 -0000 1.1 +++ pktstat-1.8.5-smtp_line.patch 20 Aug 2014 08:07:57 -0000 1.2 @@ -1,95 +1,46 @@ --- a/tcp_smtp.c +++ b/tcp_smtp.c -@@ -141,84 +141,6 @@ - *t = 0; - } - --static void --smtp_line(f, line) -- struct flow *f; -- const char *line; --{ -- struct smtp_state *state; -- const char *s; -- int addr_changed = 0; +@@ -149,13 +149,9 @@ + struct smtp_state *state; + const char *s; + int addr_changed = 0; -FILE*log; -- -- state = (struct smtp_state *)f->udata; -- + + state = (struct smtp_state *)f->udata; + -if ((log = fopen("/tmp/smtp.log", "a"))) - fprintf(log, "smpt_line [%s]\n", line); - -- if (state->in_data) { -- if (strcmp(line, ".") == 0) { -- state->in_data = 0; -- state->from_addr[0] = 0; -- state->to_addr[0] = 0; -- } else if (state->in_header) { -- if (!*line) -- state->in_header = 0; --#if 0 -- /* Tag the Subject: line inside DATA */ -- else if ((line[0] == 'S' || line[0] == 's') && -- (line[1] == 'U' || line[1] == 'u') && -- (line[2] == 'B' || line[2] == 'b') && -- (line[3] == 'J' || line[3] == 'j') && -- (line[4] == 'E' || line[4] == 'e') && -- (line[5] == 'C' || line[5] == 'c') && -- (line[6] == 'T' || line[6] == 't') && -- line[7] == ':') -- snprintf(f->desc, sizeof f->desc, "%s", line); --#endif -- } -- } else { -- /* Normalize the command line */ -- normalize_line(line); + if (state->in_data) { + if (strcmp(line, ".") == 0) { + state->in_data = 0; +@@ -180,18 +176,15 @@ + } else { + /* Normalize the command line */ + normalize_line(line); -if (log)fprintf(log, "normalized to [%s]\n", line); -- if ((s = strip_prefix(line, "MAIL FROM:"))) { -- snprintf(state->from_addr, sizeof state->from_addr, "%s", s); -- normalize_addr(state->from_addr); -- addr_changed = 1; + if ((s = strip_prefix(line, "MAIL FROM:"))) { + snprintf(state->from_addr, sizeof state->from_addr, "%s", s); + normalize_addr(state->from_addr); + addr_changed = 1; -if (log)fprintf(log, "from_addr = [%s]\n", state->from_addr); -- } -- else if ((s = strip_prefix(line, "RCPT TO:"))) { -- snprintf(state->to_addr, sizeof state->to_addr, "%s", s); -- normalize_addr(state->to_addr); -- addr_changed = 1; + } + else if ((s = strip_prefix(line, "RCPT TO:"))) { + snprintf(state->to_addr, sizeof state->to_addr, "%s", s); + normalize_addr(state->to_addr); + addr_changed = 1; -if (log)fprintf(log, "to_addr = [%s]\n", state->to_addr); -- } -- else if (strcmp(line, "DATA") == 0) { -- state->in_data = 1; -- state->in_header = 1; -- } -- else if (strcmp(line, "STARTTLS") == 0) { -- state->state = sENCRYPTED; -- snprintf(f->desc, sizeof f->desc, "STARTTLS"); -- } -- -- if ((addr_changed || -- strcmp(line, "QUIT") == 0 || -- strcmp(line, "DATA") == 0) && -- (*state->from_addr && *state->to_addr)) -- { -- snprintf(f->desc, sizeof f->desc, "%s -> %s", -- state->from_addr, state->to_addr); -- } else { -- if (strcmp(line, "QUIT") != 0) -- snprintf(f->desc, sizeof f->desc, "%s", line); -- } + } + else if (strcmp(line, "DATA") == 0) { + state->in_data = 1; +@@ -213,10 +206,7 @@ + if (strcmp(line, "QUIT") != 0) + snprintf(f->desc, sizeof f->desc, "%s", line); + } -if (log)fprintf(log, "set desc to: [%s]\n", f->desc); -- } + } - -if (log)fclose(log); --} -- + } + /* - * Look for simple SMTP (RFC 2822) commands. - */ -@@ -270,7 +192,6 @@ - case sEXPECT_LF: - if (*d == LF) { - state->line[state->line_len] = 0; -- smtp_line(f, state->line); - state->line_len = 0; - state->state = sLINE; - } else if (*d == CR) {
