Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: archiving mail



Stephen Turnbull wrote:

Hey, I thought you were going to ignore TLUG for a while!

> I note that Simon's script does flock'ing on the mboxes; this is
> absolutely essential if you operate on mboxes that might be written
> to.  It should be safe on almost all Linux systems, as flock is the
> default for mail locking.  

I think Simon's solution has a race condition, though, since he
moves the old one away, creates (with truncation) a new one, and *then*
flocks it, and while the three operations are individually atomic, all sorts
of things could happen between individual calls. If mail gets delivered
between the move and new creation, the mail could get truncated; if it
gets delivered between creation and flock, it could get overwritten by
whatever the script does afterwards. It seems quite unlike Simon to make
mistakes like that, though, so I could be wrong. Corrections welcome.

I tried to point this out in mail last night, but GOL's name server was in
la-la land or something and I couldn't get the mail through.

Shimpei.


-----------------------------------------------------------------------
Next Technical Meeting: July 8 (Sat)  13:30  Place: LinuxProbe Hall
Next Nomikai meeting: August 18 (Fri) 19:00  Place: TBD
-----------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links