Hi Sam. We're trying to reconcile courier with the openwall patch (again).
We're trying to figure out how to patch courier so that it doesn't conflict
with the "no hard links to files other people own" rule. This has led us
to the tmpscan() function called in courierdb.C. We're trying to figure
out what the motivation is for putting hardlinks to all the files in
a single directory. We've been staring at the code for a while, and
can't really figure it out. Would you mind giving us some insight into
why things are built this way, so we can figure out how to approach the
problem?
Thanks!
John Watson & Chris Wright
p.s. I've attached Chris' mail to me, just for completeness.
----- Forwarded message from Chris Wright <chr...@wirex.com> -----
Date: Mon, 27 Nov 2000 20:26:39 -0800
To: jo...@wirex.com
Subject: courierd tmpscan()
User-Agent: Mutt/1.2.5i
X-Editor: Vim http://www.vim.org/
X-Info: http://www.wirex.com
John,
Here is the best I can figure from courier-0.28 source...
courierdb.C [line 124] main()
rc=courierbmain();
-> courierd.C [line 300] courierbmain() /* this function contains the main loop
*/
while (!shutdown_flag && doscantmp && msgq::tmpscan())
-> cdmsgq.C msgq::tmpscan() /* this function does the hardlink */
if (link(ctlfile, qname))
the _rough_ algorithm for tmpscan looks something like:
open the tmpdir and go into all the subdirs.
in a subdir look for control files (Cxxx files).
if it's old remove it, otherwise...
generate new datafile and new control file names
make sure they don't already exist
get a new name (called qname) for the msgq (link target)
link the control file to the new qname (this is what is failing)
rename the data file to the new data file
rename the control file to the new control file (this won't affect the link)
add control file to the queue (a call to queuescan3)
i don't understand why tmpscan makes the hardlinks...any ideas???
later,
-chris
----- End forwarded message -----