{"id":304,"date":"2011-03-22T11:43:30","date_gmt":"2011-03-22T17:43:30","guid":{"rendered":"http:\/\/www.brunerd.com\/blog\/?p=304"},"modified":"2011-09-29T11:11:07","modified_gmt":"2011-09-29T16:11:07","slug":"finders-nasty-inherited-acl-bug-aka-error-41","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2011\/03\/22\/finders-nasty-inherited-acl-bug-aka-error-41\/","title":{"rendered":"Finder&#8217;s Nasty Inherited ACL Bug (aka Error -41)"},"content":{"rendered":"<h1>Finder&#8217;s Inherited ACL handling is broken<\/h1>\n<p>Support for\u00a0inherited ACLs on folders is still in disarray in 10.6.7 (and has been since 10.6.5), there have been a few reports here and there, some mentioning Error -41, other saying it was AFP, but I&#8217;ve <a href=\"http:\/\/openradar.appspot.com\/9160099\" target=\"_blank\">whittled it down<\/a> and it&#8217;s a Finder flaw handling inherited ACLs that was introduced in 10.6.3!<\/p>\n<h2>Hands On Demo<\/h2>\n<p>Let&#8217;s create a folder in your home directory using Terminal to make a nice little nested folder set to play with :<br \/>\n<code>mkdir -p ~\/ACLShackles\/1\/2\/3\/4\/5\/6\/7\/8\/9\/10\/11<\/code><\/p>\n<p>Now let&#8217;s add an entry to the folder&#8217;s ACL, in this case \u00a0<strong>inherited folder and file <\/strong>Read &amp; Write permissions, a common setup for workgroups that share a folder. OS X&#8217;s Server Admin sets inheritance by default when adding a user\u00a0to an ACL, to do this with OS X Client you must use chmod:<\/p>\n<p><code>chmod +a \"$(whoami) allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit\" ~\/ACLShackles\/<\/code><\/p>\n<p>Make sure the above is all on one line and paste into Terminal.<br \/>\nNow, that the permissions are set double check with: <code>ls -led ~\/ACLShackles<\/code><\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/ACLShacles-ls-led.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-314\" title=\"ACLShacles-ls-led\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/ACLShacles-ls-led.png\" alt=\"\" width=\"975\" height=\"47\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/ACLShacles-ls-led.png 975w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/ACLShacles-ls-led-300x14.png 300w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/a><\/p>\n<p>Now duplicate folder structure we made called &#8220;1&#8221; with Command-D, now try and duplicate &#8220;1 copy&#8221; \u00a0&#8212; it fails. Finder Error -41.<\/p>\n<p>Looking at the ACL in Terminal isn&#8217;t pretty:<br \/>\nls -leR \/Users\/brunerj\/ACLShackles\/1\\ copy\\ 2<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/LotsaACLs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-318\" title=\"LotsaACLs\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/LotsaACLs-245x300.png\" alt=\"\" width=\"245\" height=\"300\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/LotsaACLs-245x300.png 245w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/LotsaACLs-838x1024.png 838w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/LotsaACLs.png 1179w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/a><\/p>\n<p>It goes on to 108&#8230;<\/p>\n<p>If you don&#8217;t like Terminal, I&#8217;ve got an Applescript for you:\u00a0<a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Error41.zip\">Error41.zip<br \/>\n<\/a><\/p>\n<p>Just download and, open the resulting Error41.dmg, open and run Error41.scpt to get this result:<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/AppleScript_Error41.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-305\" title=\"AppleScript_Error41\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/AppleScript_Error41.png\" alt=\"\" width=\"399\" height=\"116\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/AppleScript_Error41.png 399w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/AppleScript_Error41-300x87.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/a><\/p>\n<h2>Step-by-step illustrated Demo<\/h2>\n<p>Let&#8217;s try another example and illustrate.<\/p>\n<p>Now, let&#8217;s copy in Chess.app, take a look at the permissions with the Inspector (Command-Option-I), notice the Permissions (for this example I added a different user in the ACL to avoid confusion between the Unix permission and the ACL when looking at Finder&#8217;s Get Info, it&#8217;s the same silhouette):<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-289\" title=\"chess0\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-225x300.png\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-225x300.png 225w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0.png 279w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-lsle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285\" title=\"chess0-lsle\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-lsle.png\" alt=\"\" width=\"1013\" height=\"27\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-lsle.png 1013w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess0-lsle-300x7.png 300w\" sizes=\"auto, (max-width: 1013px) 100vw, 1013px\" \/><\/a><\/p>\n<p>Looks good, and how it should. Now duplicate Chess.app within this folder with a Command-D:<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-288\" title=\"chess1\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-225x300.png\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-225x300.png 225w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1.png 279w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-lsle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-282\" title=\"chess1-lsle\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-lsle.png\" alt=\"\" width=\"1012\" height=\"56\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-lsle.png 1012w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess1-lsle-300x16.png 300w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/a><\/p>\n<p>Uh-oh. Something&#8217;s not right. It&#8217;s duplicated the original ACE (Access Control Entry) and added one for me the duplicator that seems to mimic my Unix permissions.<\/p>\n<p>Copy the copy.<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-287\" title=\"chess2\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-225x300.png\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-225x300.png 225w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2.png 279w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-lsle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-284\" title=\"chess2-lsle\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-lsle.png\" alt=\"\" width=\"1016\" height=\"85\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-lsle.png 1016w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess2-lsle-300x25.png 300w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/a><\/p>\n<p>Much worse. It&#8217;s now duplicating my erroneous ACE and the ACE of the test user as well.<\/p>\n<p>Copy the copy.<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Checkmate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-290\" title=\"Checkmate\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Checkmate.png\" alt=\"\" width=\"479\" height=\"187\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Checkmate.png 479w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Checkmate-300x117.png 300w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" \/><\/a><\/p>\n<p>Oh dear.\u00a0Fail. Error -41. Checkmate.<\/p>\n<p>Let&#8217;s look at that third failed and truncated copy in Finder<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3.png\"><img loading=\"lazy\" decoding=\"async\" title=\"chess3\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3-225x300.png\" alt=\"\" width=\"225\" height=\"300\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3-lsle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-283\" title=\"chess3-lsle\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3-lsle.png\" alt=\"\" width=\"1019\" height=\"114\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3-lsle.png 1019w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/chess3-lsle-300x33.png 300w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/a><\/p>\n<p>Care to see how long an ACL is inside the app?<\/p>\n<p><a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/HelpChess3ACL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-291\" title=\"HelpChess3ACL\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/HelpChess3ACL-202x300.png\" alt=\"\" width=\"202\" height=\"300\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/HelpChess3ACL-202x300.png 202w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/HelpChess3ACL-690x1024.png 690w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/HelpChess3ACL.png 1105w\" sizes=\"auto, (max-width: 202px) 100vw, 202px\" \/><\/a><\/p>\n<p>Yes. <strong>110<\/strong> ACEs are on &#8220;Chess copy 3.app\/Contents&#8221;!<\/p>\n<h3>Comparing other file manager&#8217;s behavior<\/h3>\n<p>cp doesn&#8217;t suffer the same fate as Finder when making copies of copies.<\/p>\n<p>This simulates Finder&#8217;s copy of a copy, delete any existing duplicate folders and try this:<\/p>\n<p><code>cp -Rp 1 1\\ copy;\u00a0cp -Rp 1\\ copy 1\\ copy\\ 2;\u00a0cp -Rp 1\\ copy\\ 2 1\\ copy\\ 3;\u00a0cp -Rp 1\\ copy\\ 3 1\\ copy\\ 4<\/code><\/p>\n<p>Take a <a href=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/cp-Rp.png\" target=\"_blank\">look<\/a> inside with\u00a0<code>ls -leR ~\/ACLShackles<\/code>, nice and clean, one ACE per ACL on each folder the way it should be.<\/p>\n<p>Rixstep&#8217;s <a title=\"XFile\" href=\"http:\/\/rixstep.com\/4\/0\/td.shtml\" target=\"_blank\">XFile<\/a> &#8211; doesn&#8217;t exhibit this behavior when copying or duplicating either, Rixstep software is quite conscientious about doing the Right Thing\u2122<\/p>\n<p><a title=\"Path Finder\" href=\"http:\/\/www.cocoatech.com\/\" target=\"_blank\">Path Finder<\/a> however duplicates ACLs just like Finder, but instead of Error -41 when an ACL gets too long and deep it just hangs instead. What&#8217;s interesting is what calls is PathFinder using? They have an SDK but have only taken a cursory look, regardless it&#8217;s the same result as Finder.<\/p>\n<h3>In conclusion&#8230;<\/h3>\n<p>For OS X Server environments, this affects crucial workflow behavior where multiple people act upon the same files and folders. ACLs quickly stack up and render Finder unusable. Currently the last known proper behavior for Finder was 10.6.2. Then 10.6.3 and 10.6.4, added the quirk of \u00a0adding an ACL entry that mimicked the UNIX permissions of the user doing the copy operation, but at least the ACEs weren&#8217;t duplicated\u00a0<em>ad nauseum<\/em>. But taking the insanity to new heights was 10.6.5, 10.6.6, and now 10.6.7 with the duplication bug that makes working with inherited permissions unbearable.\u00a0Luckily for OS X Client, this is minimized since Finder does not enable Inheritance for files or folders, but then you lose out on what inherited ACLs could do for you and your workgroup!<\/p>\n<p>Since 10.6.7 is out now, 10.6.8 might be your last chance to have Snow Leopard&#8217;s Finder ACL behavior put back in working order. Let Apple know this is important to you, file a bug report at\u00a0<a title=\"Apple Bug Reporter\" href=\"http:\/\/bugreporter.apple.com\" target=\"_blank\">Apple&#8217;s Bug Reporter site<\/a>, you can reference my bug number: <a href=\"http:\/\/openradar.appspot.com\/9160099\">9160099<\/a> (you can view it at OpenRadar\u00a0)<\/p>\n<p>P.S. If you are wondering why I didn&#8217;t file this earlier since I am so detailed in the earlier 10.6 behavior? I actually became aware of something wrong in 10.6.5 but I also wasn&#8217;t sure what the cause was, Client, Server, AFP, Active Direcroty? Our UIDs are 10 digits long! During that time I hoped the soon to be released 10.6.6 would fix it, but when it didn&#8217;t I spent a lot of time just trying to fix it and clean the ACLs, it wasn&#8217;t until\u00a0last week during the final seed of 10.6.7 that I found time to set up a new server and incrementally test 10.6, 10.6.2, 10.6.3, 10.6.4, 10.6.5, 10.6.6, and 10.6.7, recording QT Screen captures for each one and that took some time! My bug report only got in this Sunday. Oh well better late than never! :\/<\/p>\n<h4>Remedies<\/h4>\n<p>It&#8217;s easy to nuke all the ACLs in a given folder, but then you&#8217;ll probably want them set back up again to be of any use! Anyway this will recursively wipe the ACLs from everything in the folder you&#8217;re in, be careful, you could wipe your own access! So it&#8217;s best for the server admin to to run from the server itself, then re-propagate the ACLs for the Share (actually you may not be able to delete ACLs from client anyway):<\/p>\n<p><code>chmod -RN *<\/code><\/p>\n<h3>Update (3\/23\/11):<\/h3>\n<p>So I left my ACLShackles folder in my home foder and Time Machine failed to backup (backupd error -41, surprise.) so to avoid that, delete ACLShackles and\/or turn off Time Machine while you play around with this&#8230;<\/p>\n<p>Update (Sep 2011):<br \/>\nJust posting my comment down at the bottom so you don&#8217;t have to scroll all the way down there to read it&#8230;<\/p>\n<table  class=\" table table-hover\" cellspacing=\"0\">\n<tbody id=\"the-comment-list\">\n<tr id=\"comment-6167\">\n<td>10.6.8 has addressed it for the most part. You\u2019ll still get weirdness when duplicating folders with inherited folders inside a folder with inherited permissions, but it\u2019s a linear rather than geometric and that\u2019s bearable.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Finder&#8217;s Inherited ACL handling is broken Support for\u00a0inherited ACLs on folders is still in disarray in 10.6.7 (and has been since 10.6.5), there have been a few reports here and there, some mentioning Error -41, other saying it was AFP, but I&#8217;ve whittled it down and it&#8217;s a Finder flaw handling inherited ACLs that was [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,16,4],"tags":[],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-apple","category-bugs","category-os-x"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":13,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":317,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions\/317"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}