]> Pileus Git - ~andy/fetchmail/commitdiff
Added nosyslog.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jul 1998 13:45:37 +0000 (13:45 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jul 1998 13:45:37 +0000 (13:45 -0000)
svn path=/trunk/; revision=1967

NEWS
driver.c
fetchmail.c
fetchmail.man
options.c
sample.rcfile

diff --git a/NEWS b/NEWS
index c50e2d6a18473de723772adafd541cd139648188..3a3f1ac1bdb92402e785da796ce331120a44c029 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@
 fetchmail-4.5.2 ():
 * German-language internationalization in the RPM, thanks to Jochen Hayek.
 * .fetchmailrc files are now permitted to be executable by user and group.
+* Eric Daniel's guard code against very long lines.
+* Added --nosyslog option.
 
 fetchmail-4.5.1 (Wed Jul  1 19:27:56 EDT 1998):
 * Checkalias option from Enrico Musio <enrico.musio@spaziozerouno.it>.
index cd632afd0744a0f4822f8a965b6a37c4ce7fd767..220ce41a23c9952caa831f201607f3d31e809290 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -1630,7 +1630,7 @@ int len;          /* length of message */
 flag forward;          /* TRUE to forward */
 {
     int        linelen;
-    unsigned char buf[MSGBUFSIZE+1];
+    unsigned char buf[MSGBUFSIZE+4];
     unsigned char *inbufp = buf;
     flag issoftline = FALSE;
 
@@ -1638,7 +1638,7 @@ flag forward;             /* TRUE to forward */
     while (protocol->delimited || len > 0)
     {
        set_timeout(ctl->server.timeout);
-       if ((linelen = SockRead(sock, inbufp, sizeof(buf)-1-(inbufp-buf)))==-1)
+       if ((linelen = SockRead(sock, inbufp, sizeof(buf)-4-(inbufp-buf)))==-1)
        {
            set_timeout(0);
            if (ctl->mda)
@@ -1694,9 +1694,16 @@ flag forward;            /* TRUE to forward */
        /* ship out the text line */
        if (forward && (!issoftline))
        {
-           int n = stuffline(ctl, buf);
+           int n;
            inbufp = buf;
 
+           /* guard against very long lines */
+           buf[MSGBUFSIZE+1] = '\r';
+           buf[MSGBUFSIZE+2] = '\n';
+           buf[MSGBUFSIZE+3] = '\0';
+
+           n = stuffline(ctl, buf);
+
            if (n < 0)
            {
                error(0, errno, "writing message text");
index a15a5328dbf1da1fe0793ccc60cbd61208443e86..148d175ab8ca4c483b6d2101b8ec33b5bdfebfde 100644 (file)
@@ -970,7 +970,7 @@ static int load_params(int argc, char **argv, int optind)
     if (cmd_run.invisible)
        run.invisible = cmd_run.invisible;
     if (cmd_run.use_syslog)
-       run.use_syslog = cmd_run.use_syslog;
+       run.use_syslog = (cmd_run.use_syslog == FLAG_TRUE);
 
     /* check and daemon options are not compatible */
     if (check_only && run.poll_interval)
index 67b0f02e362fa5c185e2d1cf7bb962237085eb75..1831b0405360f56b7cd018f22839b200cb2ceabc 100644 (file)
@@ -644,6 +644,13 @@ indicate the status of the daemon and the results while fetching mail
 from the server(s).
 Error messages for command line options and parsing the \fI.fetchmailrc\fR
 file are still written to stderr, or the specified log file if the
+The
+.B --nosyslog
+option turns off use of 
+.IR syslog (3),
+assuming it's turned on in the 
+.I .fetchmailrc 
+file.
 .B -L
 or
 .B --logfile
@@ -990,6 +997,9 @@ T}
 syslog         \&      T{
 Do error logging through syslog(3).
 T}
+nosyslog       \&      T{
+Turn off error logging through syslog(3).
+T}
 .TE
 .PP
 Remember that all user options must \fIfollow\fR all server options.
index d18008ad9b072f6b8a8874378ea0d758dfdf7bc8..63623e68022945ac0918ccbc79266852eec8368b 100644 (file)
--- a/options.c
+++ b/options.c
 #define LA_LOGFILE     9
 #define LA_INVISIBLE   10
 #define LA_SYSLOG      11
-#define LA_RCFILE      12
-#define LA_IDFILE      13
-#define LA_PROTOCOL    14
-#define LA_UIDL                15
-#define LA_PORT                16
-#define LA_AUTHENTICATE        17
-#define LA_TIMEOUT     18
-#define LA_ENVELOPE    19
-#define LA_QVIRTUAL     20
-#define LA_USERNAME    21
-#define LA_ALL          22
-#define LA_NOKEEP      23
-#define        LA_KEEP         24
-#define LA_FLUSH        25
-#define LA_NOREWRITE   26
-#define LA_LIMIT       27
-#define LA_FOLDER      28
-#define LA_SMTPHOST    29
-#define LA_SMTPADDR     30
-#define LA_ANTISPAM    31
-#define LA_BATCHLIMIT  32
-#define LA_FETCHLIMIT  33
-#define LA_EXPUNGE     34
-#define LA_MDA         35
-#define LA_NETSEC      36
-#define LA_INTERFACE    37
-#define LA_MONITOR      38
-#define LA_CONFIGDUMP  39
-#define LA_YYDEBUG     40
+#define LA_NOSYSLOG    12
+#define LA_RCFILE      13
+#define LA_IDFILE      14
+#define LA_PROTOCOL    15
+#define LA_UIDL                16
+#define LA_PORT                17
+#define LA_AUTHENTICATE        18
+#define LA_TIMEOUT     19
+#define LA_ENVELOPE    20
+#define LA_QVIRTUAL     21
+#define LA_USERNAME    22
+#define LA_ALL          23
+#define LA_NOKEEP      24
+#define        LA_KEEP         25
+#define LA_FLUSH        26
+#define LA_NOREWRITE   27
+#define LA_LIMIT       28
+#define LA_FOLDER      29
+#define LA_SMTPHOST    30
+#define LA_SMTPADDR     31
+#define LA_ANTISPAM    32
+#define LA_BATCHLIMIT  33
+#define LA_FETCHLIMIT  34
+#define LA_EXPUNGE     35
+#define LA_MDA         36
+#define LA_NETSEC      37
+#define LA_INTERFACE    38
+#define LA_MONITOR      39
+#define LA_CONFIGDUMP  40
+#define LA_YYDEBUG     41
 
 /* options still left: CgGhHjJoORUwWxXYz */
 static const char *shortoptions = 
@@ -78,6 +79,7 @@ static const struct option longoptions[] = {
   {"logfile",  required_argument, (int *) 0, LA_LOGFILE     },
   {"invisible",        no_argument,       (int *) 0, LA_INVISIBLE   },
   {"syslog",   no_argument,       (int *) 0, LA_SYSLOG      },
+  {"nosyslog", no_argument,       (int *) 0, LA_NOSYSLOG    },
   {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE      },
   {"idfile",   required_argument, (int *) 0, LA_IDFILE      },
 
@@ -469,7 +471,11 @@ struct query *ctl; /* option record to be initialized */
            break;
 
        case LA_SYSLOG:
-           rctl->use_syslog = TRUE;
+           rctl->use_syslog = FLAG_TRUE;
+           break;
+
+       case LA_NOSYSLOG:
+           rctl->use_syslog = FLAG_FALSE;
            break;
 
        case '?':
index b1e8da063e5f85e78bdc0fa81f8dae8f7ce525c9..32627ce45c4df9414714976d2a8e3da17144349c 100644 (file)
@@ -38,8 +38,8 @@
 #   monitor                   -- must be followed by device
 #   dns
 #   no dns
-#   checkalias                -- do multidrop address compaison by IP address
-#   no checkalias             -- do multidrop address compaison by name
+#   checkalias                -- do multidrop address comparison by IP address
+#   no checkalias             -- do multidrop address comparison by name
 #
 #   username (or user)        -- must be followed by a name
 #   is                        -- must be followed by one or more names