reconstruct caused mailboxes (skiplist) corruption?

Bron Gondwana brong at fastmail.fm
Thu Nov 11 22:14:44 EST 2010


On Thu, Nov 11, 2010 at 11:58:04PM -0200, Henrique de Moraes Holschuh wrote:
> It _will_ write to stderr (aka fd 2).  If we want to be safe, we make sure
> fds 0-2 are sane, and we check when we open sockets/files that we did not
> get fds below 3...
> 
> > Bron ( a while later, fd 2 gets re-used as the mailboxes.db handle, and hence
> >        the mess is created )
> 
> Indeed.
> 
> We *CANNOT* afford to have any files or sockets opened with fd 0, 1 or 2. We
> should core-dump immediately if that happens, I think.

How about this skanky patch (attached?) - checks fds at the start, and if it
gets fd 2, it holds it open (to /dev/null) for the life of the process, making
sure nothing else gets it.  If it gets 0 or 1 it just croaks.

Bron.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Protect-STDERR-on-FreeBSD.patch
Type: text/x-diff
Size: 1261 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20101112/df19454c/attachment.bin 


More information about the Info-cyrus mailing list