{"id":98995,"date":"2018-06-13T07:00:00","date_gmt":"2018-06-13T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=98995"},"modified":"2019-03-13T00:42:12","modified_gmt":"2019-03-13T07:42:12","slug":"20180613-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180613-00\/?p=98995","title":{"rendered":"Why does the CREATOR_OWNER SID sometimes reset itself to the object&#8217;s current owner rather than its original owner?"},"content":{"rendered":"<p>I noted some time ago that the <code>CREATOR_<\/code><code>OWNER<\/code> security identifier (SID) is not a shorthand that refers to the object&#8217;s current owner. Rather, <a HREF=\"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20160524-00\/?p=93515\">the <code>CREATOR_<\/code><code>OWNER<\/code> SID is a template that is applied when the object is created<\/a>. When the template is applied, all occurrences of <code>CREATOR_<\/code><code>OWNER<\/code> are replaced with the object&#8217;s current owner, and it is the replaced SID that controls access. Changing the object&#8217;s owner doesn&#8217;t cause these access control entries to be recalculated;&sup1; they continue to refer to the captured value. <\/p>\n<p>A customer observed this phenomenon when they created a folder with an inheritable access control entry (ACE) for <code>CREATOR_<\/code><code>OWNER<\/code>. They observed that those access control entries were indeed propagated to child objects, with the <code>CREATOR_<\/code><code>OWNER<\/code> changed to the object&#8217;s actual owner. Furthermore, if they went to the Security properties and changed the child object&#8217;s owner, the ACE was not recalculated to update the ACE&#8217;s SID from the old owner to the new owner. <\/p>\n<p>However (and this is the weird part), if they use the Security properties to make some unrelated change to the object&#8217;s access control list (ACL), then this has a side effect of recalculating the ACEs and updating the <code>CREATOR_<\/code><code>OWNER<\/code>-sourced ACEs to refer to the new owner. <\/p>\n<p>This recalculation is not being done by the security infrastructure. It&#8217;s being done by the ACL editor. <\/p>\n<p>When you change the access control list for an item, the ACL editor calls <code>Tree&shy;Set&shy;Named&shy;Security&shy;Info<\/code> and passes an ACL that consists only of the non-inherited ACEs, and it sets the <code>UNPROTECTED_<\/code><code>DACL_<\/code><code>SECURITY_<\/code><code>INFORMATION<\/code> flag, which means &#8220;Oh, and also inherit ACEs from my parent, as if I were newly-created.&#8221; <\/p>\n<p>In other words, the ACL edit deletes all the ACEs that were obtained by inherance, and then creates new ACEs based on the current parent&#8217;s inheritable ACEs. <\/p>\n<p>The ACL editor is trying to be helpful, but it ends up being confusing. <\/p>\n<p>&sup1; What would this recalculation even mean if the object was moved to a new folder after being created, or if the containing folder&#8217;s access control list were modified in the interim? I guess you could have a bit somewhere in the ACE that says, &#8220;This was originally created from a template that used <code>CREATOR_<\/code><code>OWNER<\/code>.&#8221; The closest thing to that is the <code>INHERITED_<\/code><code>ACE<\/code> bit, which says &#8220;This ACE was autogenerated via inheritance,&#8221; but it doesn&#8217;t give any information as to what the original ACE was. Suppose the object&#8217;s current owner is Bob. If an ACE applies to Bob and has the <code>INHERITED_<\/code><code>ACE<\/code> bit set, it could mean that the original template ACE&#8217;s SID was <code>CREATOR_<\/code><code>OWNER<\/code> that was changed to Bob during template application because Bob was the original owner, or it could mean that the original template ACE&#8217;s SID was <code>CREATOR_<\/code><code>GROUP<\/code> that was changed to Bob during template application because Bob was the original group, or it could mean that the original template ACE&#8217;s SID was Bob all along. <\/p>\n<p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a snapshot, but you can ask for a new snapshot.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-98995","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>It&#8217;s a snapshot, but you can ask for a new snapshot.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=98995"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98995\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=98995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=98995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=98995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}