1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-20 16:23:51 +03:00

netcmd: Fix opening SamDB database for offline backup

When opening the backed-up SamDB database, open the top-level database
without loading any modules so the backend database files aren't
unnecessarily opened. The domain SID is now fetched from the original
database rather than from the backup.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14676

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
This commit is contained in:
Joseph Sutton
2021-03-22 11:06:30 +13:00
committed by Andrew Bartlett
parent bb3dcd403c
commit d7c111514a
3 changed files with 16 additions and 9 deletions

View File

@@ -551,7 +551,7 @@ def backup_online(smb_conn, dest_tarfile_path, dom_sid):
shutil.rmtree(localdir)
def backup_offline(src_service_path, dest_tarfile_path, samdb_conn, smb_conf_path):
def backup_offline(src_service_path, dest_tarfile_path, smb_conf_path, dom_sid):
"""
Backup files and ntacls to a tarfile for a service
"""
@@ -559,9 +559,6 @@ def backup_offline(src_service_path, dest_tarfile_path, samdb_conn, smb_conf_pat
tempdir = tempfile.mkdtemp()
session_info = system_session_unix()
dom_sid_str = samdb_conn.get_domain_sid()
dom_sid = security.dom_sid(dom_sid_str)
ntacls_helper = NtaclsHelper(service, smb_conf_path, dom_sid)
for dirpath, dirnames, filenames in os.walk(src_service_path):