On Mon, Aug 06, 2001 at 09:44:36PM -0400, Rudy Zung wrote:
[snip]
> Hmmm. I hadn't thought of that possibility; however, I am hoping that I
> wouldn't "casually" lose an email message because the file name is
> constructed by the combination of the system time and the process ID, which
> should be sufficiently unique, except possibly when the system clock is
> reset, and the PIDs recycle. The tmp file name is given to stat() which
> makes sure that the filename does not yet exist where the tmp directory has
> AFS ACL system:anyuser lidk (so, this allows anybody to delete the file, but
> should that happen, then the rename would fail, and qmail should notice that
> error and defer delivery (I hope)). 

Yes, if the rename() fails and you haven't broken anything massively,
qmail will note that delivery failed and try again later.

> The next part is that I am now using rename() to "move" the file from tmp to
> new. For the new directory, I have AFS ACL system:anyuser ik. The
> system:anyuser has no permission to delete files, and this is what I am
> using to hope that the rename() will not be able to overwrite an existing
> file because that would mean a delete would have to be done, or the file
> would have to be rewritten, which are not permissible with ik ACLs.

I am completely unfamiliar with AFS. If the non-delete clause makes
sure rename() doesn't replace any file, that would be cool and should
be sufficient as far as I can see.

> I guess what I can do is to modify qmail-local.c's maildir_child() and make
> it always generate the same file name as a test case and see how it behaves.

Sounds like a plan. Please do :)

> That's just what I'm surmising; certainly glad for any input so that I don't
> totally mangle my email and start losing all sorts of email.
> 
> Nevertheless, thank you for the rename() unsafe warning.

You're welcome. Let us know how you progress.

Oh, and be sure to, whenever you ask questions in the future, point
out that you are using modified maildir delivery. We love to know
about that before we break our heads :) Just a hint.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

Reply via email to