[Dovecot] Apple patches 1-5

Mike Abbott michael.abbott at apple.com
Tue Dec 16 18:26:53 EET 2008


>> 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.

I will try to be more descriptive up front with the remaining  
patches.  This is why I started with some small ones.  Thank you for  
your cooperation.

>> 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?

>> Patch #3.  Some versions of Mac OS X return near-duplicate kevents.
>
> This probably won't affect other BSDs, so I think the duplicate  
> removal
> should be around #ifdef __APPLE__?

I have no data to support that conclusion.

>> 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.

>> Patch #5.  Required by Apple's lawyers.
>
> That's fine by me.

Phew!


More information about the dovecot mailing list