Re: Why fstat() in qmail-send.c:markdone()?

2000-03-19 Thread D. J. Bernstein
Fred Lindberg writes: It's obviously important or it wouldn't be there. It's a variable that was used with the original qmail queue structure. It's unused now, and can be removed safely. ---Dan

Re: Why fstat() in qmail-send.c:markdone()?

2000-03-15 Thread Fred Lindberg
On Fri, 10 Mar 2000 14:42:15 -0600, Fred Lindberg wrote: fd = open_write(fn.s); if (fd == -1) break; if (fstat(fd,st) == -1) { close(fd); break; } if (seek_set(fd,pos) == -1) { close(fd); break; } Ok, I get it. qmail-send doesn't trust qmailq. Without the fstat() call, qmailq could

Re: Why fstat() in qmail-send.c:markdone()?

2000-03-15 Thread Dave Sill
"Fred Lindberg" [EMAIL PROTECTED] wrote: call, qmailq could (via symlink) cause qmail-send (root) to write to an qmail-send runs as qmails, not root. -Dave

Re: Why fstat() in qmail-send.c:markdone()?

2000-03-15 Thread Fred Lindberg
On Wed, 15 Mar 2000 11:59:11 -0500 (EST), Dave Sill wrote: qmail-send runs as qmails, not root. Yes. And the file in question is owned by qmails not qmailq in a directory writable only by qmails. If open fails to report an error, this should become obvious in write(). The fstat() info is not

Why fstat() in qmail-send.c:markdone()?

2000-03-10 Thread Fred Lindberg
It's obviously important or it wouldn't be there. Can anyone explain why? From qmail-send.c: markdone(): for (;;) { fd = open_write(fn.s); if (fd == -1) break; if (fstat(fd,st) == -1) { close(fd); break; } if (seek_set(fd,pos) == -1) { close(fd); break; } if (write(fd,"D",1)

Re: Why fstat() in qmail-send.c:markdone()?

2000-03-10 Thread Len Budney
"Fred Lindberg" [EMAIL PROTECTED] wrote: It's obviously important or it wouldn't be there. Can anyone explain why? Forgive my speculation--if I'm wrong, somebody correct me! My guess is that fstat() follows open() because of system-specific open() bugs. On NFS, for example, open() will