David Levine [Sun, 9 Feb 2014 15:58:00 +0000 (09:58 -0600)]
Added -[no]textcharset switches to mhshow(1). These only apply if
nmh was configured with iconv(3) support. If -textcharset is not
used, mhshow will convert, if necessary, the charset of text/plain
content to match the user's locale setting.
David Levine [Mon, 3 Feb 2014 04:34:14 +0000 (22:34 -0600)]
netbsd uses flock by default for mail spool locking, as reported
by Robert Elz. Use *netbsd* to also include knetbsd, though I
don't know for sure that it uses flock.
David Levine [Sun, 2 Feb 2014 22:45:23 +0000 (16:45 -0600)]
Removed some unused code that forked /bin/mkdir to make a new
directory if an the effective and real uids differed. There are no
setuid executables in nmh.
David Levine [Sun, 2 Feb 2014 15:58:45 +0000 (09:58 -0600)]
Removed all unnecessary setuid/setgid calls. Using setuid as an
example and not showing the setgid analogues:
1) setuid(getuid());
This dropped privileges before an exec and is normally a
good thing. Except here, the return value isn't checked.
And, we don't have any setuid programs in nmh now, so it was
unnecessary.
2) if (geteuid() == 0) setuid(pw->pw_uid);
This would have been a security hole if the executable was
setuid root because the user specifies the source of the pw
data. This was in slocal(1), which is not setuid, so this
was certainly not needed.
3) setuid(geteuid());
This was in post(8) for when it called the sendmail
executable directly (-mts sendmail or -mts sendmail/pipe.
It's not necessary with modern sendmail or replacements.
David Levine [Sun, 2 Feb 2014 14:46:25 +0000 (08:46 -0600)]
Added m_mktemps(), which creates a temporary file with a specified
suffix. It uses mkstemps(3) where available, which should be most
modern platforms. If not available, it tries link(2), and if that
fails, rename(2).
David Levine [Sat, 25 Jan 2014 15:15:05 +0000 (09:15 -0600)]
Replaced boilerplate at beginning of each nmh program with new
nmh_init() function. It sets up an atexit() function and signal
handlers so that all temporary files are removed when the program
terminates, however that happens. It relies on a call in m_mktemp()
to register each temporary file for removal. See new "nmh temporary
files" section in README.developers and comments in m_mktemp.c.
David Levine [Sat, 25 Jan 2014 03:10:03 +0000 (21:10 -0600)]
Removed 3 renames of temporary files in mhparse.c. They added
unnecessary filename extensions to the temp files. They weren't good
from a security standpoint and added a failure mode.
Ken Hornstein [Fri, 24 Jan 2014 17:38:03 +0000 (12:38 -0500)]
In my over-eager trimming I didn't realize the fallback code that
used the mhshow-suffix configuration information to determine the
MIME type was removed; put that back into mime_type().
David Levine [Fri, 24 Jan 2014 04:16:34 +0000 (22:16 -0600)]
Replaced use of mkstemp() with m_mktemp2() in header_fd() of
rcvtty.c. It never would have worked, anyway, because it had 5
instead of 6 X's in the template.
Ken Hornstein [Wed, 22 Jan 2014 20:22:07 +0000 (15:22 -0500)]
Convert whatnow over to using the new Attach header.
Mark the old -attach switches as deprecated (and make them not show
up in help). Still more documentation cleanup to do.
Ken Hornstein [Wed, 22 Jan 2014 03:35:35 +0000 (22:35 -0500)]
Make viamail read the user's profile; this is required because sendsbr()
wants to call mhbuild, which can be overridden via the user's profile
(which is required for the test suite to work).
David Levine [Wed, 22 Jan 2014 02:55:57 +0000 (20:55 -0600)]
Always check that mktemp()/mktemp2() succeeds before trying to
use result. And if it fails, have the error message report
the directory where the failed temporary file creation occurred.
And, removed all chmod()'s of temporary files created by mktemp()/
mktemp2() because they set the umask to 077 before calling mkstemp(3).
David Levine [Tue, 21 Jan 2014 03:08:47 +0000 (21:08 -0600)]
Replaced use of m_mktemp() with m_mktemp2() so that tmp files created
by attach, burst, mhbuild, and post will be in the directory specified
by the first non-null of {MHTMPDIR, TMPDIR, TMP, MH Path directory}.
David Levine [Mon, 20 Jan 2014 16:31:16 +0000 (10:31 -0600)]
Fixed three LC_ALL settings:
1) Replaced en_US.ISO8859-1 with C because that's sufficient to show
decoding with an invalid multibyte sequence.
2) Removed redundant LC_ALL=en_US.UTF-8; that is set for the entire test.
3) Removed the last en_US.ISO8859-1 because it hid what the test was
trying to show.
David Levine [Mon, 20 Jan 2014 05:21:51 +0000 (23:21 -0600)]
Removed "tmp" from the uip/mh* programs, so that they no longer
use the nmh-storage profile component for their tmp files. Or
their invoname, but that will be taken care of later.
David Levine [Fri, 17 Jan 2014 03:48:01 +0000 (21:48 -0600)]
Moved readline check to after termcap/curses check in configure.ac.
This way, $TERMLIB can be included in the readline check. That's
neeed on CentOS 5.9.
David Levine [Fri, 17 Jan 2014 01:55:58 +0000 (19:55 -0600)]
Moved readconfig() of mhn.defaults into construct_build_directive().
This way, platforms that don't define MIMETYPEPROC will display
the proper directive with attach -v.
David Levine [Wed, 15 Jan 2014 02:09:40 +0000 (20:09 -0600)]
Added check to get_file_info() in attach.c for failed fgets() call.
It can happen on Cygwin for mysterious reasons,
http://cygwin.com/faq/faq.html#faq.using.bloda.