1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

python:netcmd: Explicitly delete samdb variables

This makes our intent clear, and avoids accidental attempts to use these
objects after they have been ‘disconnect()’ed.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Jo Sutton 2024-07-19 10:21:56 +12:00 committed by Douglas Bagnall
parent 9542c419a0
commit 9e7c37550a

View File

@ -1182,7 +1182,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
# not use this any more as the data has all been copied under
# the transaction
samdb.disconnect()
samdb = None
del samdb
# Open the new backed up samdb, flag it as backed up, and write
# the next SID so the restore tool can add objects. We use
@ -1200,7 +1200,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
# Close the backed up samdb
samdb.disconnect()
samdb = None
del samdb
# Now handle all the LDB and TDB files that are not linked to
# anything else. Use transactions for LDBs.