Curtis Generous <[EMAIL PROTECTED]> wrote:
>
> I'm trying to use safecat on a very busy email server, and noticed
> while looking at the output of truss(1) that all writes to the file
> are being done a single character at the time...
That may be excessively draconian on my part! Back when I wrote safecat,
I used 1-byte writes when possible, because it eliminated the need for
logic handling the case that 0<write(n)<n, in which it's necessary to back
up and rewrite the missing characters. When n=1, the result of write()
must be one of error (-1), temporary failure (0), and success (1).
I've assumed that most filesystems are block-buffered anyway, and safecat
doesn't call sync() until it's finished writing the entire file. Has
this caused a measurable performance problem in your setting?
I haven't revisited that in some time; if anyone has a comment or insight
please let me know. Otherwise, I'll look into updating safecat Real Soon
Now. It needs one or two minor things anyway.
Thanks,
Len.
PS One of the things safecat needs is to write the "Delivered-To:" and
"Return-Path:" lines when DTLINE and RPLINE are set. If you're using
qmail-pop3d or serialmail, that's a more serious problem for you--which
I plan to fix RSN.
PPS Switching to substdio/stralloc would also eliminate that problem.
I might do that, now that I've decided to stop worrying about Dan's view
of people reusing his code in their projects. As long as I handle any
maintenance costs, I'm assuming Dan doesn't care one way or the other.
--
Security is completely separate from functionality, and no amount of
beta testing can ever uncover a security flaw.
-- Bruce Schneier