- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
- KNF
- ensure hostname has trailling nul.
- use initgroups/setgid/setuid rather than just setuid, and do this earlier.
- find "from:" and "subject:" as well.
- use strvis(3) rather than some local crufty code.
This closes an apparent security problem on systems where users have
write access to the mail spool. Since root actually runs comsat, a
user could link their mail file to a system file that they normally
could not access, and use comsat to view said file. This fix simply
makes sure that the mail file is a REGular file.