samba-tool domain backup: Use new ldb.disconnect() method to force-close files during...
authorAndrew Bartlett <abartlet@samba.org>
Tue, 5 Dec 2023 23:38:54 +0000 (12:38 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 05:13:32 +0000 (05:13 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/netcmd/domain/backup.py

index fc7ff534a9e66e3ec1b13414abfbee34d8d5f121..a9a5a5beacf779503462cbc23c40e0bd4572d6bb 100644 (file)
@@ -1172,6 +1172,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
         # Close the original samdb, to avoid any confusion, we will
         # not use this any more as the data has all been copied under
         # the transaction
+        samdb.disconnect()
         samdb = None
 
         # Open the new backed up samdb, flag it as backed up, and write
@@ -1189,6 +1190,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
         add_backup_marker(samdb, "backupType", "offline")
 
         # Close the backed up samdb
+        samdb.disconnect()
         samdb = None
 
         # Now handle all the LDB and TDB files that are not linked to