summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@suse.com>2022-07-18 09:19:24 -0600
committerJeremy Allison <jra@samba.org>2022-07-22 20:40:51 +0000
commitb4d7540bb4798e6801accf34a26fc0f2636bdd1f (patch)
tree333d580912bbeba02ca6cf940aad27105ccaf41a /python
parent30c40046ef0b52da1dee3a65117c20da2a75955b (diff)
downloadsamba-b4d7540bb4798e6801accf34a26fc0f2636bdd1f.tar.gz
samba-b4d7540bb4798e6801accf34a26fc0f2636bdd1f.tar.bz2
samba-b4d7540bb4798e6801accf34a26fc0f2636bdd1f.zip
gpo: samba-gpupdate use s3 param for registry conf
Cause samba-gpupdate to use an s3 param so that it can load settings from registry configuration. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 22 20:40:51 UTC 2022 on sn-devel-184
Diffstat (limited to 'python')
-rw-r--r--python/samba/getopt.py9
-rw-r--r--python/samba/gp/gpclass.py7
2 files changed, 10 insertions, 6 deletions
diff --git a/python/samba/getopt.py b/python/samba/getopt.py
index 7b8d2ef46c5..a271cd8a736 100644
--- a/python/samba/getopt.py
+++ b/python/samba/getopt.py
@@ -93,6 +93,15 @@ class SambaOptions(optparse.OptionGroup):
return self._lp
+class Samba3Options(SambaOptions):
+ """General Samba-related command line options with an s3 param."""
+
+ def __init__(self, parser):
+ SambaOptions.__init__(self, parser)
+ from samba.samba3 import param as s3param
+ self._lp = s3param.get_context()
+
+
class VersionOptions(optparse.OptionGroup):
"""Command line option for printing Samba version."""
def __init__(self, parser):
diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py
index 0c95cdb66c0..39a34a75cf0 100644
--- a/python/samba/gp/gpclass.py
+++ b/python/samba/gp/gpclass.py
@@ -32,7 +32,6 @@ import re
from samba.net import Net
from samba.dcerpc import nbt
from samba.samba3 import libsmb_samba_internal as libsmb
-from samba.samba3 import param as s3param
import samba.gpo as gpo
from samba.param import LoadParm
from uuid import UUID
@@ -406,14 +405,10 @@ def check_safe_path(path):
def check_refresh_gpo_list(dc_hostname, lp, creds, gpos):
- # the SMB bindings rely on having a s3 loadparm
- s3_lp = s3param.get_context()
- s3_lp.load(lp.configfile)
-
# Force signing for the connection
saved_signing_state = creds.get_smb_signing()
creds.set_smb_signing(SMB_SIGNING_REQUIRED)
- conn = libsmb.Conn(dc_hostname, 'sysvol', lp=s3_lp, creds=creds)
+ conn = libsmb.Conn(dc_hostname, 'sysvol', lp=lp, creds=creds)
# Reset signing state
creds.set_smb_signing(saved_signing_state)
cache_path = lp.cache_path('gpo_cache')