[Dovecot] Apple patches 1-5

Timo Sirainen tss at iki.fi
Tue Dec 16 18:35:34 EET 2008


On Dec 16, 2008, at 6:26 PM, Mike Abbott wrote:

>>> Patch #1.  Some versions of Mac OS X have buggy CMSG_* macros.
>>
>> Is the nopen() check really necessary?
>
> It might detect buggy CMSG macros on non-Apple systems.
>
>> I'd like to know at least what kind of a bug it works around for  
>> before applying it.
>
> The 64-bit CMSG macros are broken in such a way that two descriptors  
> are sometimes passed (depending on the value in uninitialized  
> memory, often 0), not one.  The nopen() check looks for that.

Hmm. OK, I guessed it was probably something like that. There's  
probably a better way to test it by seeing if two fds were received,  
but since fd_read() doesn't support it I guess the nopen() check is  
fine.

>>> Patch #2.  Don't set "<username>=1" in the environment.
>>
>> I put the fix to auth-client.c:
>> http://hg.dovecot.org/dovecot-1.1/rev/3145be9f66ae
>
> Two points:
>
> 1.  Yes, if you see a better way to achieve the same goal for any of  
> Apple's patches, please do adopt the better way.
> 2.  However, in this case your change will prevent one of our future  
> patches from working properly.  It will need the user name in the  
> extra_fields array in deliver.c.  May I suggest that you take patch  
> #2 as-is?

Hmm. Maybe. I'll see about it when you send the future patch. :)  
Anyway in v1.2 the auth lookup API has changed already and the  
username is received in a different parameter (and this bug was  
already fixed there already).

>>> Patch #4.  Null renames are actually pretty slow on HFS (Apple's  
>>> file
>>> system), so avoid them.
>>
>> I've thought about adding a similar check before, but it removes an
>> intentional side effect: It makes sure that the file exists. If it
>> doesn't exist (flags had changed), its new name is looked up and the
>> rename is tried again. Would it be faster to instead stat() to see if
>> the file exists?
>
> I wondered about that.  Sure, a stat() would be faster.

OK, I'll add that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20081216/cf35506a/attachment.bin 


More information about the dovecot mailing list