From: Tim Beale Date: Thu, 13 Dec 2018 04:31:23 +0000 (+1300) Subject: netcmd: Change domain backup commands to use s3 SMB Py bindings X-Git-Tag: talloc-2.1.15~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=792b8d3f8338988c2288bc3dc58e72cacbba2154;p=thirdparty%2Fsamba.git netcmd: Change domain backup commands to use s3 SMB Py bindings This means we can now backup a DC that has SMBv1 disabled. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale Reviewed-by: Douglas Bagnall Autobuild-User(master): Tim Beale Autobuild-Date(master): Mon Jan 14 06:49:09 CET 2019 on sn-devel-144 --- diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py index 58d5a4c3510..4cacf571f3d 100644 --- a/python/samba/netcmd/domain_backup.py +++ b/python/samba/netcmd/domain_backup.py @@ -27,7 +27,8 @@ import tdb import samba.getopt as options from samba.samdb import SamDB, get_default_backend_store import ldb -from samba import smb +from samba.samba3 import libsmb_samba_internal as libsmb +from samba.samba3 import param as s3param from samba.ntacls import backup_online, backup_restore, backup_offline from samba.auth import system_session from samba.join import DCJoinContext, join_clone, DCCloneAndRenameContext @@ -103,7 +104,10 @@ def get_sid_for_restore(samdb): def smb_sysvol_conn(server, lp, creds): """Returns an SMB connection to the sysvol share on the DC""" - return smb.SMB(server, "sysvol", lp=lp, creds=creds, sign=True) + # the SMB bindings rely on having a s3 loadparm + s3_lp = s3param.get_context() + s3_lp.load(lp.configfile) + return libsmb.Conn(server, "sysvol", lp=s3_lp, creds=creds, sign=True) def get_timestamp(): diff --git a/selftest/knownfail.d/domain_backup b/selftest/knownfail.d/domain_backup deleted file mode 100644 index 24f4d87981c..00000000000 --- a/selftest/knownfail.d/domain_backup +++ /dev/null @@ -1,12 +0,0 @@ -# these tests only work with SMBv1, which is disabled on the restoredc -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_one_way_links\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_backup_untar\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_backup_restore_with_conf\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_backup_restore_no_secrets\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_backup_restore_into_site\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupRename.test_backup_restore\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupOnline.test_backup_untar\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupOnline.test_backup_restore_with_conf\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupOnline.test_backup_restore_no_secrets\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupOnline.test_backup_restore_into_site\(restoredc:local\) -samba.tests.domain_backup.samba.tests.domain_backup.DomainBackupOnline.test_backup_restore\(restoredc:local\)