Here are the first few simple patches from Apple, based on dovecot-1.1.7. The comments with "APPLE" in them helped us merge in your new releases; feel free to remove them. Please let me know if you want subsequent patches in a different format, or if you have any questions. Patch #1. Some versions of Mac OS X have buggy CMSG_* macros. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch1 Type: application/octet-stream Size: 1515 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20081215/decaba25/attachment-0010.obj> -------------- next part -------------- Patch #2. Don't set "<username>=1" in the environment. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch2 Type: application/octet-stream Size: 549 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20081215/decaba25/attachment-0011.obj> -------------- next part -------------- Patch #3. Some versions of Mac OS X return near-duplicate kevents. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch3 Type: application/octet-stream Size: 1004 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20081215/decaba25/attachment-0012.obj> -------------- next part -------------- Patch #4. Null renames are actually pretty slow on HFS (Apple's file system), so avoid them. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch4 Type: application/octet-stream Size: 767 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20081215/decaba25/attachment-0013.obj> -------------- next part -------------- Patch #5. Required by Apple's lawyers. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch5 Type: application/octet-stream Size: 419 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20081215/decaba25/attachment-0014.obj> -------------- next part --------------
On Mon, Dec 15, 2008 at 12:39 PM, Mike Abbott <michael.abbott at apple.com> wrote:> Patch #5. Required by Apple's lawyers.Patch 5 seems spurious to me, regardless of what Apple's lawyers want. Three of the four patches are working around bugs in Apple's own OS. Most are a few lines. Sending patches upstream are great, but in any project I've been a part of, these are not conditions under which someone gets to claim copyright, especially on something as elusive as "portions". --Jeff
On Mon, 2008-12-15 at 11:39 -0600, Mike Abbott wrote:> Here are the first few simple patches from Apple, based on > dovecot-1.1.7. The comments with "APPLE" in them helped us merge in > your new releases; feel free to remove them. Please let me know if > you want subsequent patches in a different format, or if you have any > questions. > > Patch #1. Some versions of Mac OS X have buggy CMSG_* macros.Is the nopen() check really necessary? I'd like to know at least what kind of a bug it works around for before applying it. The fstat()+inode comparing doesn't catch it?> 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> 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__?> 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? v1.2 suppresses unnecessary flag changes, so these dummy renames (or stat()s) should happen less often.> Patch #5. Required by Apple's lawyers.That's fine by me. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20081216/6f44ff22/attachment-0002.bin>
>> 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/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?>> 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!
Summary: On Mon, 2008-12-15 at 11:39 -0600, Mike Abbott wrote:> Here are the first few simple patches from Apple, based on > dovecot-1.1.7. The comments with "APPLE" in them helped us merge in > your new releases; feel free to remove them. Please let me know if > you want subsequent patches in a different format, or if you have any > questions. > > Patch #1. Some versions of Mac OS X have buggy CMSG_* macros.http://hg.dovecot.org/dovecot-1.1/rev/a217d9ae130b> Patch #2. Don't set "<username>=1" in the environment.Waiting for your next patch to see if I should do it this way or some other way.> Patch #3. Some versions of Mac OS X return near-duplicate kevents.http://hg.dovecot.org/dovecot-1.1/rev/d178293dde50> Patch #4. Null renames are actually pretty slow on HFS (Apple's file > system), so avoid them.http://hg.dovecot.org/dovecot-1.1/rev/92921985e4f5> Patch #5. Required by Apple's lawyers.http://hg.dovecot.org/dovecot-1.1/rev/859099ac07bb -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20081219/6485af28/attachment-0002.bin>
Following up. You checked in slightly different versions of patches 1, 3 and 4 and released them with 1.1.8. We will test your solutions for these and adopt them if they work. Thanks! For all the changes you checked into 1.1 on our behalf, will they also be included in 1.2?