]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py:samdb: add get_linearized to dsdb_dn
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 30 Jul 2025 04:40:15 +0000 (16:40 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 7 Aug 2025 23:28:33 +0000 (23:28 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
python/samba/dbchecker.py
python/samba/samdb.py

index ff9dca6391b02fbc0f658568add9318af2960d80..0bc30d008d9dda871e2385e69200e46e414a83e3 100644 (file)
@@ -1497,7 +1497,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                     # otherwise the LDB code will correct it on the way through
                     # (Note: we still want to preserve the DSDB DN prefix in the
                     # case of binary DNs)
-                    bad_dn = dsdb_dn.prefix + dsdb_dn.dn.get_linearized()
+                    bad_dn = dsdb_dn.get_linearized()
                     self.err_dn_string_component_old(obj.dn, attrname, bad_dn,
                                                      dsdb_dn, res[0].dn)
                 continue
index 483bfd7a71ccd169f37296a64d3fa48ea4fc4288..51739bb02fa097291cbc31b364512229674415e3 100644 (file)
@@ -1741,6 +1741,11 @@ class BaseDsdbDn:
         dnstr = self.dn.extended_str(mode=1)
         return f"{self.prefix}{dnstr}"
 
+    def get_linearized(self) -> str:
+        """Return the DN as a string without any extended attributes."""
+        dnstr = self.dn.get_linearized()
+        return f"{self.prefix}{dnstr}"
+
 
 class PlainDn(BaseDsdbDn):
     """This does very little, other than providing the sort order (via