]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2-20041220
authorWietse Venema <wietse@porcupine.org>
Mon, 20 Dec 2004 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:30:21 +0000 (06:30 +0000)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/postcat/postcat.c
postfix/src/util/Makefile.in
postfix/src/util/dummy_read.c [new file with mode: 0644]
postfix/src/util/dummy_write.c [new file with mode: 0644]
postfix/src/util/iostuff.h

index f986ee5c6b8c1c757b43abafd2ff013369ae18f2..036b06aa705e98080751882e223a675d28056464 100644 (file)
@@ -9980,6 +9980,15 @@ Apologies for any names omitted.
        util/name_mask.[hc], global/ehlo_mask.[hc], smtpd/smtpd.c,
        smtp/smtp.c, smtp/smtp_proto.c.
 
+20041219
+
+       Bugfix: postcat without -o was broken. File: postcat/postcat.c.
+
+20041220
+
+       Dummy VSTREAM read-write routines. Files: util/dummy_read.c,
+       util/dummy_write.c.
+
 Open problems:
 
        Med: implement ${name[?:]value} in main.cf or update the
index bca7472cd1c161ffbd860eb00bd6c250b1563208..c8832a4bc09d4d9283129c5706590e183f5688c0 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20041219"
+#define MAIL_RELEASE_DATE      "20041220"
 #define MAIL_VERSION_NUMBER    "2.2"
 
 #define VAR_MAIL_VERSION       "mail_version"
index c9b6961ffda62c4672b54201d547e21fb068aa75..5de23acbcfe4c772f550bb454352a0af2d5a9569 100644 (file)
@@ -105,6 +105,7 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags)
     int     first = 1;
     int     ch;
     off_t   offset;
+    int     in_message = 0;
 
 #define TEXT_RECORD(rec_type) \
            (rec_type == REC_TYPE_CONT || rec_type == REC_TYPE_NORM)
@@ -135,8 +136,8 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags)
            vstream_printf("*** ENVELOPE RECORDS %s ***\n", VSTREAM_PATH(fp));
            first = 0;
        }
-       if ((prev_type == REC_TYPE_CONT && !TEXT_RECORD(rec_type))
-           || !(flags & PC_FLAG_OFFSET))
+       if (prev_type == REC_TYPE_CONT && in_message && !msg_verbose
+           && ((flags & PC_FLAG_OFFSET) != 0 || !TEXT_RECORD(rec_type)))
            VSTREAM_PUTCHAR('\n');
        if (flags & PC_FLAG_OFFSET)
            vstream_printf("%9lu ", (unsigned long) offset);
@@ -147,9 +148,9 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags)
            vstream_printf("%s: %s", rec_type_name(rec_type),
                           asctime(localtime(&time)));
            break;
-       case REC_TYPE_CONT:
+       case REC_TYPE_CONT:                     /* REC_TYPE_FILT collision */
            if (msg_verbose)
-               vstream_printf("%s: ", rec_type_name(rec_type));
+               vstream_printf("unterminated_text: ");
            vstream_fwrite(VSTREAM_OUT, STR(buffer), LEN(buffer));
            if (msg_verbose)
                VSTREAM_PUTCHAR('\n');
@@ -162,9 +163,11 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags)
            break;
        case REC_TYPE_MESG:
            vstream_printf("*** MESSAGE CONTENTS %s ***\n", VSTREAM_PATH(fp));
+           in_message = 1;
            break;
        case REC_TYPE_XTRA:
            vstream_printf("*** HEADER EXTRACTED %s ***\n", VSTREAM_PATH(fp));
+           in_message = 0;
            break;
        case REC_TYPE_END:
            vstream_printf("*** MESSAGE FILE END %s ***\n", VSTREAM_PATH(fp));
index f3afec78424a49f134a481ee0a24041e0d272069..a271eb5ab74dade28cc7d9e24d9e97f96500ace3 100644 (file)
@@ -29,7 +29,7 @@ SRCS  = alldig.c argv.c argv_split.c attr_print0.c attr_print64.c \
        write_buf.c write_wait.c auto_clnt.c attr_clnt.c attr_scan_plain.c \
        attr_print_plain.c sane_connect.c neuter.c name_code.c \
        uppercase.c unix_recv_fd.c stream_recv_fd.c unix_send_fd.c \
-       stream_send_fd.c dict_sdbm.c hex_code.c
+       stream_send_fd.c dict_sdbm.c hex_code.c dummy_read.c dummy_write.c
 OBJS   = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \
        attr_scan0.o attr_scan64.o base64_code.o basename.o binhash.o \
        chroot_uid.o clean_env.o close_on_exec.o concatenate.o ctable.o \
@@ -60,7 +60,7 @@ OBJS  = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \
        write_buf.o write_wait.o auto_clnt.o attr_clnt.o attr_scan_plain.o \
        attr_print_plain.o sane_connect.o $(STRCASE) neuter.o name_code.o \
        uppercase.o unix_recv_fd.o stream_recv_fd.o unix_send_fd.o \
-       stream_send_fd.o dict_sdbm.o hex_code.o
+       stream_send_fd.o dict_sdbm.o hex_code.o dummy_read.o dummy_write.o
 HDRS   = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.h \
        connect.h ctable.h dict.h dict_db.h dict_cdb.h dict_dbm.h dict_env.h \
        dict_cidr.h dict_ht.h dict_ni.h dict_nis.h \
@@ -842,6 +842,14 @@ doze.o: doze.c
 doze.o: sys_defs.h
 doze.o: msg.h
 doze.o: iostuff.h
+dummy_read.o: dummy_read.c
+dummy_read.o: sys_defs.h
+dummy_read.o: msg.h
+dummy_read.o: iostuff.h
+dummy_write.o: dummy_write.c
+dummy_write.o: sys_defs.h
+dummy_write.o: msg.h
+dummy_write.o: iostuff.h
 dup2_pass_on_exec.o: dup2_pass_on_exec.c
 duplex_pipe.o: duplex_pipe.c
 duplex_pipe.o: sys_defs.h
diff --git a/postfix/src/util/dummy_read.c b/postfix/src/util/dummy_read.c
new file mode 100644 (file)
index 0000000..f70dc38
--- /dev/null
@@ -0,0 +1,61 @@
+/*++
+/* NAME
+/*     dummy_read 3
+/* SUMMARY
+/*     dummy read operation
+/* SYNOPSIS
+/*     #include <iostuff.h>
+/*
+/*     int     dummy_read(fd, buf, buf_len, timeout, context)
+/*     int     fd;
+/*     void    *buf;
+/*     unsigned len;
+/*     int     timeout;
+/*     void    *context;
+/* DESCRIPTION
+/*     dummy_read() reports an EOF condition without side effects.
+/*
+/*     Arguments:
+/* .IP fd
+/*     File descriptor in the range 0..FD_SETSIZE. Its value is logged
+/*     when verbose logging is turned on.
+/* .IP buf
+/*     Read buffer pointer. Not used.
+/* .IP buf_len
+/*     Read buffer size. Its value is logged when verbose logging is
+/*     turned on.
+/* .IP timeout
+/*     The deadline in seconds. Not used.
+/* .IP context
+/*     Application context. Not used.
+/* DIAGNOSTICS
+/*     None.
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
+/*--*/
+
+/* System library. */
+
+#include <sys_defs.h>
+
+/* Utility library. */
+
+#include <msg.h>
+#include <iostuff.h>
+
+/* dummy_read - dummy read operation */
+
+int     dummy_read(int fd, void *unused_buf, unsigned len,
+                          int unused_timeout, void *unused_context)
+{
+    if (msg_verbose)
+       msg_info("dummy_read: fd %d, len %d", fd, len);
+    return (0);
+}
diff --git a/postfix/src/util/dummy_write.c b/postfix/src/util/dummy_write.c
new file mode 100644 (file)
index 0000000..a9e6969
--- /dev/null
@@ -0,0 +1,61 @@
+/*++
+/* NAME
+/*     dummy_write 3
+/* SUMMARY
+/*     dummy write operation
+/* SYNOPSIS
+/*     #include <iostuff.h>
+/*
+/*     int     dummy_write(fd, buf, buf_len, timeout, context)
+/*     int     fd;
+/*     void    *buf;
+/*     unsigned len;
+/*     int     timeout;
+/*     void    *context;
+/* DESCRIPTION
+/*     dummy_write() implements a data sink without side effects.
+/*
+/*     Arguments:
+/* .IP fd
+/*     File descriptor in the range 0..FD_SETSIZE. Its value is logged
+/*     when verbose logging is turned on.
+/* .IP buf
+/*     Write buffer pointer. Not used.
+/* .IP buf_len
+/*     Write buffer size. Its value is logged when verbose logging is
+/*     turned on.
+/* .IP timeout
+/*     The deadline in seconds. Not used.
+/* .IP context
+/*     Application context. Not used.
+/* DIAGNOSTICS
+/*     None.
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
+/*--*/
+
+/* System library. */
+
+#include <sys_defs.h>
+
+/* Utility library. */
+
+#include <msg.h>
+#include <iostuff.h>
+
+/* dummy_write - dummy write operation */
+
+int     dummy_write(int fd, void *unused_buf, unsigned len,
+                          int unused_timeout, void *unused_context)
+{
+    if (msg_verbose)
+       msg_info("dummy_write: fd %d, len %d", fd, len);
+    return (len);
+}
index 05c57d1cb36280f0445ae4d3870ae2d93f9eb201..7d04346c8154b046d1868e373b4a9f4fc5011f3c 100644 (file)
@@ -33,6 +33,8 @@ extern int stream_recv_fd(int);
 extern int stream_send_fd(int, int);
 extern int unix_recv_fd(int);
 extern int unix_send_fd(int, int);
+extern int dummy_read(int, void *, unsigned, int, void *);
+extern int dummy_write(int, void *, unsigned, int, void *);
 
 #define BLOCKING       0
 #define NON_BLOCKING   1