8c0e70483dc16c6a5a9bb4cc8cc3ec1298ee7d29
[packages/sendmail.git] / sendmail-format_string.patch
1 diff -ruNp sendmail-8.15.2.orig/sendmail/envelope.c sendmail-8.15.2/sendmail/envelope.c
2 --- sendmail-8.15.2.orig/sendmail/envelope.c    2014-06-12 19:30:47.000000000 +0200
3 +++ sendmail-8.15.2/sendmail/envelope.c 2018-02-21 12:59:15.364725322 +0100
4 @@ -323,7 +323,7 @@ dropenvelope(e, fulldrop, split)
5  
6                         /* don't free, allocated from e_rpool */
7                         e->e_message = sm_rpool_strdup_x(e->e_rpool, buf);
8 -                       message(buf);
9 +                       message("%s", buf);
10                         e->e_flags |= EF_CLRQUEUE;
11                 }
12                 if (msg_timeout == MSG_NOT_BY)
13 @@ -420,7 +420,7 @@ dropenvelope(e, fulldrop, split)
14                                 /* don't free, allocated from e_rpool */
15                                 e->e_message = sm_rpool_strdup_x(e->e_rpool,
16                                                                  buf);
17 -                               message(buf);
18 +                               message("%s", buf);
19                                 e->e_flags |= EF_WARNING;
20                         }
21                         if (msg_timeout == MSG_WARN_BY)
22 diff -ruNp sendmail-8.15.2.orig/sendmail/parseaddr.c sendmail-8.15.2/sendmail/parseaddr.c
23 --- sendmail-8.15.2.orig/sendmail/parseaddr.c   2015-03-18 12:47:12.000000000 +0100
24 +++ sendmail-8.15.2/sendmail/parseaddr.c        2018-02-21 12:59:15.386725225 +0100
25 @@ -218,7 +218,7 @@ parseaddr(addr, a, flags, delim, delimpt
26                         msg = "Deferring message until queue run";
27                 if (tTd(20, 1))
28                         sm_dprintf("parseaddr: queueing message\n");
29 -               message(msg);
30 +               message("%s", msg);
31                 if (e->e_message == NULL && e->e_sendmode != SM_DEFER)
32                         e->e_message = sm_rpool_strdup_x(e->e_rpool, msg);
33                 a->q_state = QS_QUEUEUP;
34 diff -ruNp sendmail-8.15.2.orig/sendmail/srvrsmtp.c sendmail-8.15.2/sendmail/srvrsmtp.c
35 --- sendmail-8.15.2.orig/sendmail/srvrsmtp.c    2015-03-18 12:47:12.000000000 +0100
36 +++ sendmail-8.15.2/sendmail/srvrsmtp.c 2018-02-21 12:59:15.409725123 +0100
37 @@ -122,6 +122,26 @@ extern ENVELOPE    BlankEnvelope;
38  #define SKIP_SPACE(s)  while (isascii(*s) && isspace(*s))      \
39                                 (s)++
40  
41 +static inline void
42 +message1(fmt)
43 +       char *fmt;
44 +{
45 +       if (strchr(fmt, '%') == NULL)
46 +               message(fmt, NULL);
47 +       else
48 +               message("%s", fmt);
49 +}
50 +
51 +static inline void
52 +usrerr1(fmt)
53 +       char *fmt;
54 +{
55 +       if (strchr(fmt, '%') == NULL)
56 +               usrerr(fmt, NULL);
57 +       else
58 +               usrerr("%s", fmt);
59 +}
60 +
61  /*
62  **  PARSE_ESMTP_ARGS -- parse EMSTP arguments (for MAIL, RCPT)
63  **
64 @@ -578,13 +598,13 @@ static bool       smtp_data __P((SMTP_T *, ENV
65                                 bool tsave = QuickAbort;                \
66                                                                         \
67                                 QuickAbort = false;                     \
68 -                               usrerr(response);                       \
69 +                               usrerr1(response);                      \
70                                 QuickAbort = tsave;                     \
71                                 e->e_sendqueue = NULL;                  \
72                                 goto doquit;                            \
73                         }                                               \
74                         else                                            \
75 -                               usrerr(response);                       \
76 +                               usrerr1(response);                      \
77                         break;                                          \
78                                                                         \
79                   case SMFIR_REJECT:                                    \
80 @@ -931,7 +951,7 @@ smtp(nullserver, d_flags, e)
81         }
82         else if (strncmp(nullserver, "421 ", 4) == 0)
83         {
84 -               message(nullserver);
85 +               message1(nullserver);
86                 goto doquit;
87         }
88  
89 @@ -1849,7 +1869,7 @@ smtp(nullserver, d_flags, e)
90                                 if (nullserver != NULL)
91                                 {
92                                         if (ISSMTPREPLY(nullserver))
93 -                                               usrerr(nullserver);
94 +                                               usrerr1(nullserver);
95                                         else
96                                                 usrerr("550 5.0.0 %s",
97                                                        nullserver);
98 @@ -2452,7 +2472,7 @@ smtp(nullserver, d_flags, e)
99                                         tempfail = true;
100                                         smtp.sm_milterize = false;
101                                         if (response != NULL)
102 -                                               usrerr(response);
103 +                                               usrerr1(response);
104                                         else
105                                                 message("421 4.7.0 %s closing connection",
106                                                         MyHostName);
107 @@ -3659,7 +3679,7 @@ smtp_data(smtp, e)
108                                 (void) extenhsc(response + 4, ' ', e->e_enhsc);
109  #endif /* _FFR_MILTER_ENHSC */
110  
111 -                       usrerr(response);
112 +                       usrerr1(response);
113                         if (strncmp(response, "421 ", 4) == 0
114                             || strncmp(response, "421-", 4) == 0)
115                         {
116 @@ -3779,7 +3799,7 @@ smtp_data(smtp, e)
117                         if (ISSMTPCODE(response))
118                                 (void) extenhsc(response + 4, ' ', e->e_enhsc);
119  #endif /* _FFR_MILTER_ENHSC */
120 -                       usrerr(response);
121 +                       usrerr1(response);
122                         if (strncmp(response, "421 ", 4) == 0
123                             || strncmp(response, "421-", 4) == 0)
124                                 rv = false;
This page took 0.030217 seconds and 2 git commands to generate.