Dear Dochelp,<div><br></div><div>I am currently trying to refactor Delete object implementation in Samba and I need some help</div><div>with algorithm used for deleting objects and how the deletion is replicated to other DCs.</div>

<div><br></div><div>Reference:</div><div> ProcessGetNCChangesReply [MS-DRSR] - <a href="http://msdn.microsoft.com/en-us/library/dd207758(v=PROT.13).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/dd207758(v=PROT.13).aspx</a></div>

<div>    UpdateObject [MS-DRSR] - <a href="http://msdn.microsoft.com/en-us/library/dd207780(v=PROT.13).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/dd207780(v=PROT.13).aspx</a></div><div><a href="http://msdn.microsoft.com/en-us/library/dd207758(v=PROT.13).aspx" target="_blank"></a> Delete Operation [MS-ADTS] - <a href="http://msdn.microsoft.com/en-us/library/cc223480(v=PROT.13).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/cc223480(v=PROT.13).aspx</a></div>

<div><br></div><div><a href="http://msdn.microsoft.com/en-us/library/cc223480(v=PROT.13).aspx" target="_blank"></a>Consider following sutiation:</div><div>0. We have two DCs configuration.</div><div>    We have an OU object with following props:</div>

<div>      dn: OU=TEST_DELETE_0417,DC=samba,DC=devel</div><div>      objectGUID: b7f1b90d-d247-45b7-87fb-f6bc916bd729</div><div><br></div><div>1. We delete this OU on DC1. The state of this object on each dc should be as follows:</div>

<div>  DC1:</div><div>      dn: OU=TEST_DELETE_0417\0ADEL:b7f1b90d-d247-45b7-87fb-f6bc916bd729,CN=Deleted Objects,DC=samba,DC=devel</div><div>      objectGUID: b7f1b90d-d247-45b7-87fb-f6bc916bd729</div><div>      isDeleted: TRUE</div>

<div>      isRecycled: TRUE</div><div>  DC2:</div><div>      dn: OU=TEST_DELETE_0417,DC=samba,DC=devel</div><div>      objectGUID: b7f1b90d-d247-45b7-87fb-f6bc916bd729</div><div>    </div><div>2. Replication is triggered from DC1 to DC2.</div>
<div>Now, according to UpdateObject() procedure, we will identify that Object&#39;s DN has changed from </div><div>&quot;dn: OU=TEST_DELETE_0417,DC=samba,DC=devel&quot; </div><div>to &quot;dn: OU=TEST_DELETE_0417\0ADEL:b7f1b90d-d247-45b7-87fb-f6bc916bd729,CN=Deleted Objects,DC=samba,DC=devel&quot;.</div>
<div>Hence we will modify object&#39;s DN (calling PerformModifyDNOperation() operation).</div><div>Which will make this object a Deleted-object right?</div><div>While progressing further in UpdateObject() procedure, we will check and see, that &#39;isDeleted&#39;</div>
<div>attribute value is TRUE, so we shall call RemoveObj() procedure. At this point I am a little bit puzzled as </div><div>there are two possible outcomes from this procedure:</div><div>1. Object&#39;s RDN should be transformed to a delete-mangled RDN. So we should end with an RDN like:</div>
<div> TEST_DELETE_0417\0ADEL:b7f1b90d-d247-45b7-87fb-f6bc916bd72\0ADEL:b7f1b90d-d247-45b7-87fb-f6bc916bd72 right? </div><div>2. Or, as the object is already under &quot;Deleted Object&quot; container (moved there by previous call to PerformModifyOperation()),</div>
<div>RemoveObj() procedure should delete it further - i.e. if the object is a Tombstone, it will be completely removed.</div><div><br></div><div><br></div><div>Sorry that my description gets so messy.</div><div>Basically what UpdateObject() states is that first we should execute PerformModifyOperation() and then RemoveObj().</div>
<div>Which is a little bit confusing, as PerformModifyOperation() will turn the object into a Deleted-object.</div><div>Calling RemoveObj() later will actually act on already modified object, so I wonder - how does RemoveObj()</div>
<div>knows that we just converted the object and this object should not be completely removed?</div><div><br></div><div>Another possibility is for PeformModifyOperation() to determine that target DN will move the object under </div>
<div>&quot;Deleted Objects&quot; container, and in this case to modify only Attribute values on the object, but not to call</div><div>PerformModifyDNOperation() operation?</div><div><br>-- <br>CU,<br>Kamen Mazdrashki<br>
<a href="mailto:kamen.mazdrashki@postpath.com" target="_blank">kamen.mazdrashki@postpath.com</a><br><a href="http://gitweb.samba.org/?p=kamenim/samba.git;a=summary" target="_blank">http://gitweb.samba.org/?p=kamenim/samba.git;a=summary</a><br>
-------------------------------------<br>
CISCO SYSTEMS BULGARIA EOOD<br><a href="http://www.cisco.com/global/BG/" target="_blank">http://www.cisco.com/global/BG/</a><br>
</div>