David Levine [Thu, 20 Feb 2014 03:36:16 +0000 (21:36 -0600)]
Generalized %{charset} display string escape to any Content-Type
parameter. Also, always quote the expanded value, whether or not
the escape was quoted in the profile.
David Levine [Wed, 19 Feb 2014 03:16:06 +0000 (21:16 -0600)]
Removed redundant quoting of %f and %F in display strings. Now,
the code checks to see if those escapes are quoted before quoting
them. Removed quoting of them in mhn.defaults.sh because it isn't
(and wasn't) necessary.
David Levine [Sun, 16 Feb 2014 20:12:15 +0000 (14:12 -0600)]
Removed remaining TMP relics missed with commit d046c8f0992fddcd69f2172a6607a14dec3b1251. Also, have mhmail clean
up a .orig tmp file, now that it always uses mhbuild.
David Levine [Tue, 11 Feb 2014 05:17:28 +0000 (23:17 -0600)]
Removed the -[no]textcharset switches that were added to mhshow(1)
in commit 721b0395fb2fceac4e66fed1009ed2f17fd5351f. They weren't
needed. So the net effect is that, if built with iconv, mhshow
will attempt to convert text/plain content to match the user's locale.
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.