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/3145be9f66aeTwo 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 filesystem), 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.
PGP.sig
Description: This is a digitally signed message part