[PATCH] samba-tool visualize uptodateness

Andrew Bartlett abartlet at samba.org
Sat Jun 9 13:20:48 UTC 2018


On Sat, 2018-06-09 at 16:56 +1200, Douglas Bagnall via samba-technical
wrote:
> +    def get_utdv(self, samdb, dn):
> +        """This finds the uptodateness vector in the database."""
> +        cursors = []
> +        for c in dsdb._dsdb_load_udv_v2(samdb, dn):
> +            inv_id = str(c.source_dsa_invocation_id)
> +            res = samdb.search(expression=("(&(invocationId=%s)"
> +                                           "(objectClass=nTDSDSA))" % inv_id),
> +                               #scope=SCOPE_SUBTREE,
> +                               controls=["search_options:1:2"],
> +                               attrs=["distinguishedName", "invocationId"])

This looks incomplete.  Firstly the comment, but also because the
search looks over-broad.  I think you just want the config partition,
eg samdb.get_config_dn().

+    def get_utdv(self, samdb, dn):
+        """This finds the uptodateness vector in the database."""
+        cursors = []
+        for c in dsdb._dsdb_load_udv_v2(samdb, dn):
+            inv_id = str(c.source_dsa_invocation_id)
+            res = samdb.search(expression=("(&(invocationId=%s)"
+                                           "(objectClass=nTDSDSA))" %
inv_id),
+                               #scope=SCOPE_SUBTREE,
+                               controls=["search_options:1:2"],
+                               attrs=["distinguishedName",
"invocationId"])

Otherwise, this looks pretty good to me.  Thank you very much, this
will be a great new feature.

Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Can you fix that up and push?

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list