Bug 15528 - samba-tool domain backup restore broken with subdomains
Summary: samba-tool domain backup restore broken with subdomains
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.19.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-07 09:39 UTC by Björn Jacke
Modified: 2023-12-07 09:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Jacke 2023-12-07 09:39:38 UTC
"samba-tool domain backup restore" fails if there exists a subdomain. This is how the restore command ends:

Removing Sysvol reference: CN=WINSRV221,CN=Topology,CN=Domain System Volume,CN=DFSR-GlobalSettings,CN=System,DC=windom1,DC=site
Removing nTDSDSA: CN=NTDS Settings,CN=WINSRV224,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=windom1,DC=site (and any children)
ERROR(ldb): uncaught exception - No such Base DN: CN=WINSRV224,OU=Domain Controllers,DC=winsubdom11,DC=windom1,DC=site
  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/netcmd/domain/backup.py", line 652, in run
    remove_dc(samdb, logger, cn)
  File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 447, in remove_dc
    offline_remove_ntds_dc(samdb, logger,
  File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 374, in offline_remove_ntds_dc
    offline_remove_server(samdb, logger, server_dn,
  File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 258, in offline_remove_server
    computer_msgs = samdb.search(base=computer_dn,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A transaction is still active in ldb context [0x23fc2c0] on /var/lib/samba-tmp/private/sam.ldb