diff --git a/postfix/HISTORY b/postfix/HISTORY index 89683247d..0f0b58c16 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -12175,10 +12175,18 @@ Apologies for any names omitted. domains without secondary MX records. Joshua Goodall. File: smtpd/smtpd_check.c. +20060604 + + Cleanup: minor fluff found with the BEAM source code analyzer. + Files: global/quote_821_local.c, global/quote_822_local.c, + master/master_spawn.c, pickup/pickup.c, util/match_ops.c, + util/safe_open.c, xsasl/xsasl_cyrus_client.c. + Wish list: - Find out if postfix_tls@aet.tu-cottbus.de is still appropriate, - and if not, update TLS_README. + Don't lose bits when converting st_dev into maildir file + name. It's 64 bits on Linux. Found with the BEAM source + code analyzer. Do or don't introduce unknown_reverse_client_reject_code. diff --git a/postfix/README_FILES/TLS_README b/postfix/README_FILES/TLS_README index 533e975cb..474fc7577 100644 --- a/postfix/README_FILES/TLS_README +++ b/postfix/README_FILES/TLS_README @@ -1056,13 +1056,10 @@ indicates a super-user shell. RReeppoorrttiinngg pprroobblleemmss -When reporting a problem, please be thorough in the report. Patches, when -possible, are greatly appreciated too. - -Please differentiate when possible between: - - * Problems in the TLS code: - * Problems in vanilla Postfix: +Problems are preferably reported via . See http:// +www.postfix.org/lists.html for subscription information. When reporting a +problem, please be thorough in the report. Patches, when possible, are greatly +appreciated too. CCoommppaattiibbiilliittyy wwiitthh PPoossttffiixx << 22..22 TTLLSS ssuuppppoorrtt diff --git a/postfix/html/TLS_README.html b/postfix/html/TLS_README.html index d2e9a3f52..748dc3dc9 100644 --- a/postfix/html/TLS_README.html +++ b/postfix/html/TLS_README.html @@ -1518,18 +1518,10 @@ super-user privileges.

Reporting problems

-

When reporting a problem, please be thorough in the report. -Patches, when possible, are greatly appreciated too.

- -

Please differentiate when possible between:

- -
    - -
  • Problems in the TLS code: <postfix_tls@aet.tu-cottbus.de> - -
  • Problems in vanilla Postfix: <postfix-users@postfix.org> - -
+

Problems are preferably reported via <postfix-users@postfix.org>. +See http://www.postfix.org/lists.html for subscription information. +When reporting a problem, please be thorough in the report. Patches, +when possible, are greatly appreciated too.

Compatibility with Postfix < 2.2 TLS support

diff --git a/postfix/proto/TLS_README.html b/postfix/proto/TLS_README.html index 31e2500bc..93f0a3c72 100644 --- a/postfix/proto/TLS_README.html +++ b/postfix/proto/TLS_README.html @@ -1518,18 +1518,10 @@ tls_random_source = dev:/dev/urandom

Reporting problems

-

When reporting a problem, please be thorough in the report. -Patches, when possible, are greatly appreciated too.

- -

Please differentiate when possible between:

- -
    - -
  • Problems in the TLS code: <postfix_tls@aet.tu-cottbus.de> - -
  • Problems in vanilla Postfix: <postfix-users@postfix.org> - -
+

Problems are preferably reported via <postfix-users@postfix.org>. +See http://www.postfix.org/lists.html for subscription information. +When reporting a problem, please be thorough in the report. Patches, +when possible, are greatly appreciated too.

Compatibility with Postfix < 2.2 TLS support

diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 9b93f878e..ddda6cc07 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -5,7 +5,7 @@ SRCS = abounce.c anvil_clnt.c been_here.c bounce.c bounce_log.c \ deliver_completed.c deliver_flock.c deliver_pass.c deliver_request.c \ dict_ldap.c dict_mysql.c dict_pgsql.c dict_proxy.c domain_list.c \ dot_lockfile.c dot_lockfile_as.c ext_prop.c file_id.c flush_clnt.c \ - header_opts.c header_token.c hold_message.c input_transp.c \ + header_opts.c header_token.c input_transp.c \ is_header.c log_adhoc.c mail_addr.c mail_addr_crunch.c \ mail_addr_find.c mail_addr_map.c mail_command_client.c \ mail_command_server.c mail_conf.c mail_conf_bool.c mail_conf_int.c \ @@ -35,7 +35,7 @@ OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ deliver_completed.o deliver_flock.o deliver_pass.o deliver_request.o \ dict_ldap.o dict_mysql.o dict_pgsql.o dict_proxy.o domain_list.o \ dot_lockfile.o dot_lockfile_as.o ext_prop.o file_id.o flush_clnt.o \ - header_opts.o header_token.o hold_message.o input_transp.o \ + header_opts.o header_token.o input_transp.o \ is_header.o log_adhoc.o mail_addr.o mail_addr_crunch.o \ mail_addr_find.o mail_addr_map.o mail_command_client.o \ mail_command_server.o mail_conf.o mail_conf_bool.o mail_conf_int.o \ @@ -65,7 +65,7 @@ HDRS = abounce.h anvil_clnt.h been_here.h bounce.h bounce_log.h \ deliver_flock.h deliver_pass.h deliver_request.h dict_ldap.h \ dict_mysql.h dict_pgsql.h dict_proxy.h domain_list.h dot_lockfile.h \ dot_lockfile_as.h ext_prop.h file_id.h flush_clnt.h header_opts.h \ - header_token.h hold_message.h input_transp.h is_header.h \ + header_token.h input_transp.h is_header.h \ lex_822.h log_adhoc.h mail_addr.h mail_addr_crunch.h \ mail_addr_find.h mail_addr_map.h mail_conf.h mail_copy.h \ mail_date.h mail_dict.h mail_error.h mail_flush.h mail_open_ok.h \ @@ -862,17 +862,6 @@ header_token.o: ../../include/vstring.h header_token.o: header_token.c header_token.o: header_token.h header_token.o: lex_822.h -hold_message.o: ../../include/msg.h -hold_message.o: ../../include/sane_fsops.h -hold_message.o: ../../include/set_eugid.h -hold_message.o: ../../include/sys_defs.h -hold_message.o: ../../include/vbuf.h -hold_message.o: ../../include/vstream.h -hold_message.o: ../../include/vstring.h -hold_message.o: hold_message.c -hold_message.o: hold_message.h -hold_message.o: mail_params.h -hold_message.o: mail_queue.h input_transp.o: ../../include/msg.h input_transp.o: ../../include/name_mask.h input_transp.o: ../../include/sys_defs.h diff --git a/postfix/src/global/hold_message.c b/postfix/src/global/hold_message.c deleted file mode 100644 index 9a79a1b95..000000000 --- a/postfix/src/global/hold_message.c +++ /dev/null @@ -1,112 +0,0 @@ -/*++ -/* NAME -/* hold_message 3 -/* SUMMARY -/* move message to hold queue -/* SYNOPSIS -/* #include -/* -/* int hold_message(path_buf, queue_name, queue_id) -/* VSTRING *path_buf; -/* const char *queue_name; -/* const char *queue_id; -/* DESCRIPTION -/* The \fBhold_message\fR() routine moves the specified -/* queue file to the \fBhold\fR queue, where it will sit -/* until someone either destroys it or releases it. -/* -/* Arguments: -/* .IP path_buf -/* A null pointer, or storage for the new pathname. -/* .IP queue_name -/* Queue name with the message that needs to be placed on hold. -/* .IP queue_id -/* Queue file name with the message that needs to be placed on hold. -/* DIAGNOSTICS -/* The result is -1 in case of failure, 0 in case of success. -/* 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 -#include /* rename() */ -#include -#include -#include - -/* Utility library. */ - -#include -#include -#include - -/* Global library. */ - -#include -#include -#include - -#define STR(x) vstring_str(x) - -/* hold_message - move message to hold queue */ - -int hold_message(VSTRING *path_buf, const char *queue_name, - const char *queue_id) -{ - VSTRING *old_path = vstring_alloc(100); - VSTRING *new_path = 0; - uid_t saved_uid; - gid_t saved_gid; - int err; - - /* - * If not running as the mail system, change privileges first. - */ - if ((saved_uid = geteuid()) != var_owner_uid) { - saved_gid = getegid(); - set_eugid(var_owner_uid, var_owner_gid); - } - - /* - * Your buffer or mine? - */ - if (path_buf == 0) - new_path = path_buf = vstring_alloc(100); - - /* - * This code duplicates mail_queue_rename(), except that it also returns - * the result pathname to the caller. - */ - (void) mail_queue_path(old_path, queue_name, queue_id); - (void) mail_queue_path(path_buf, MAIL_QUEUE_HOLD, queue_id); - if ((err = sane_rename(STR(old_path), STR(path_buf))) == 0 - || ((err = mail_queue_mkdirs(STR(path_buf)) == 0) - && (err = sane_rename(STR(old_path), STR(path_buf))) == 0)) { - if (msg_verbose) - msg_info("%s: placed on hold", queue_id); - } - - /* - * Restore privileges. - */ - if (saved_uid != var_owner_uid) - set_eugid(saved_uid, saved_gid); - - /* - * Cleanup. - */ - vstring_free(old_path); - if (new_path) - vstring_free(new_path); - - return (err); -} diff --git a/postfix/src/global/hold_message.h b/postfix/src/global/hold_message.h deleted file mode 100644 index ff0728bf0..000000000 --- a/postfix/src/global/hold_message.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _HOLD_MESSAGE_H_INCLUDED_ -#define _HOLD_MESSAGE_H_INCLUDED_ - -/*++ -/* NAME -/* hold_message 3h -/* SUMMARY -/* mark queue file as corrupt -/* SYNOPSIS -/* #include -/* DESCRIPTION -/* .nf - - /* - * External interface. - */ -extern int hold_message(VSTRING *, const char *, const char *); - -/* 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 -/*--*/ - -#endif diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 8aca55168..97688435a 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20060601" +#define MAIL_RELEASE_DATE "20060604" #define MAIL_VERSION_NUMBER "2.3" #ifdef SNAPSHOT diff --git a/postfix/src/global/quote_821_local.c b/postfix/src/global/quote_821_local.c index 1a0964cb6..8cd9b2e04 100644 --- a/postfix/src/global/quote_821_local.c +++ b/postfix/src/global/quote_821_local.c @@ -119,7 +119,7 @@ static VSTRING *make_821_quoted_string(VSTRING *dst, const char *local_part, * that need quoting when they occur in a quoted-string. */ VSTRING_ADDCH(dst, '"'); - for (cp = local_part; cp < end && (ch = *cp) != 0; cp++) { + for (cp = local_part; cp < end && (ch = *(unsigned char *) cp) != 0; cp++) { if ((ch > 127 && !(flags & QUOTE_FLAG_8BITCLEAN)) || ch == '\r' || ch == '\n' || ch == '"' || ch == '\\') VSTRING_ADDCH(dst, '\\'); diff --git a/postfix/src/global/quote_822_local.c b/postfix/src/global/quote_822_local.c index a16149d2b..9292252b4 100644 --- a/postfix/src/global/quote_822_local.c +++ b/postfix/src/global/quote_822_local.c @@ -132,7 +132,7 @@ static VSTRING *make_822_quoted_string(VSTRING *dst, const char *local_part, * that need quoting when they occur in a quoted-string. */ VSTRING_ADDCH(dst, '"'); - for (cp = local_part; cp < end && (ch = *cp) != 0; cp++) { + for (cp = local_part; cp < end && (ch = *(unsigned char *) cp) != 0; cp++) { if ((ch > 127 && !(flags & QUOTE_FLAG_8BITCLEAN)) || ch == '"' || ch == '\\' || ch == '\r') VSTRING_ADDCH(dst, '\\'); diff --git a/postfix/src/master/master_spawn.c b/postfix/src/master/master_spawn.c index 1f112bc62..41fe03392 100644 --- a/postfix/src/master/master_spawn.c +++ b/postfix/src/master/master_spawn.c @@ -219,7 +219,6 @@ void master_spawn(MASTER_SERV *serv) execvp(serv->path, serv->args->argv); msg_fatal("%s: exec %s: %m", myname, serv->path); - exit(1); /* NOTREACHED */ /* @@ -292,10 +291,8 @@ void master_reap_child(void) if (msg_verbose) msg_info("master_reap_child: pid %d", pid); if ((proc = (MASTER_PROC *) binhash_find(master_child_table, - (char *) &pid, sizeof(pid))) == 0) { + (char *) &pid, sizeof(pid))) == 0) msg_panic("master_reap: unknown pid: %d", pid); - continue; - } serv = proc->serv; if (!NORMAL_EXIT_STATUS(status)) { if (WIFEXITED(status)) diff --git a/postfix/src/pickup/pickup.c b/postfix/src/pickup/pickup.c index 01473a803..750215b6d 100644 --- a/postfix/src/pickup/pickup.c +++ b/postfix/src/pickup/pickup.c @@ -306,7 +306,7 @@ static int pickup_copy(VSTREAM *qfile, VSTREAM *cleanup, info->st.st_mtime = now; } else if (info->st.st_mtime < now - DAY_SECONDS) { msg_warn("%s: message has been queued for %d days", - info->id, (int) (now - info->st.st_mtime) / DAY_SECONDS); + info->id, (int) ((now - info->st.st_mtime) / DAY_SECONDS)); } /* diff --git a/postfix/src/util/find_inet.c b/postfix/src/util/find_inet.c index f3118b491..7ea1de31e 100644 --- a/postfix/src/util/find_inet.c +++ b/postfix/src/util/find_inet.c @@ -85,6 +85,8 @@ int find_inet_port(const char *service, const char *protocol) int port; if (alldig(service) && (port = atoi(service)) != 0) { + if (port < 0 || port > 65535) + msg_fatal("bad port number: %s", service); return (htons(port)); } else { if ((sp = getservbyname(service, protocol)) == 0) diff --git a/postfix/src/util/match_ops.c b/postfix/src/util/match_ops.c index 3f9f20eea..e05450185 100644 --- a/postfix/src/util/match_ops.c +++ b/postfix/src/util/match_ops.c @@ -219,7 +219,7 @@ int match_hostaddr(int unused_flags, const char *addr, const char *pattern) if (strcasecmp(addr, pattern) == 0) return (1); } else { - ssize_t addr_len = strlen(addr); + size_t addr_len = strlen(addr); if (strncasecmp(addr, pattern + 1, addr_len) == 0 && strcmp(pattern + 1 + addr_len, "]") == 0) diff --git a/postfix/src/util/safe_open.c b/postfix/src/util/safe_open.c index 1ecabecf2..c825493ca 100644 --- a/postfix/src/util/safe_open.c +++ b/postfix/src/util/safe_open.c @@ -188,6 +188,12 @@ static VSTREAM *safe_open_create(const char *path, int flags, mode_t mode, return (0); } + /* + * Optionally look up the file attributes. + */ + if (st != 0 && fstat(vstream_fileno(fp), st) < 0) + msg_fatal("%s: bad open file status: %m", path); + /* * Optionally change ownership after creating a new file. If there is a * problem we should not attempt to delete the file. Something else may @@ -200,12 +206,6 @@ static VSTREAM *safe_open_create(const char *path, int flags, mode_t mode, msg_warn("%s: cannot change file ownership: %m", path); } - /* - * Optionally look up the file attributes. - */ - if (st != 0 && fstat(vstream_fileno(fp), st) < 0) - msg_fatal("%s: bad open file status: %m", path); - /* * We are almost there... */ diff --git a/postfix/src/xsasl/xsasl_cyrus_client.c b/postfix/src/xsasl/xsasl_cyrus_client.c index b42065e87..4dbf2242d 100644 --- a/postfix/src/xsasl/xsasl_cyrus_client.c +++ b/postfix/src/xsasl/xsasl_cyrus_client.c @@ -379,7 +379,7 @@ static int xsasl_cyrus_client_set_security(XSASL_CLIENT *xp, * Per-session security properties. XXX This routine is not sufficiently * documented. What is the purpose of all this? */ - memset(&sec_props, 0L, sizeof(sec_props)); + memset(&sec_props, 0, sizeof(sec_props)); sec_props.min_ssf = 0; sec_props.max_ssf = 0; /* don't allow real SASL * security layer */