1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s4/scripting/bin: PY3 make sure GUID result of format is string

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Noel Power 2018-10-02 14:45:53 +01:00 committed by Andrew Bartlett
parent f94a813796
commit 1a4e95da2b
2 changed files with 4 additions and 2 deletions

View File

@ -49,6 +49,7 @@ from samba.dcerpc import netlogon, winbind
from samba.netcmd.dns import cmd_dns
from samba import gensec
from samba.kcc import kcc_utils
from samba.compat import get_string
import ldb
samba.ensure_third_party_module("dns", "dnspython")
@ -375,7 +376,7 @@ def get_subst_vars(samdb):
vars['SITE'] = samdb.server_site_name()
res = samdb.search(base=samdb.get_default_basedn(), scope=SCOPE_BASE, attrs=["objectGUID"])
guid = samdb.schema_format_value("objectGUID", res[0]['objectGUID'][0])
vars['DOMAINGUID'] = guid
vars['DOMAINGUID'] = get_string(guid)
vars['IF_DC'] = ""
vars['IF_RWDC'] = "# "

View File

@ -41,6 +41,7 @@ from samba import getopt as options
from samba.auth import system_session
from samba.samdb import SamDB
from samba.credentials import Credentials, DONT_USE_KERBEROS
from samba.compat import get_string
parser = optparse.OptionParser("samba_spnupdate")
sambaopts = options.SambaOptions(parser)
@ -79,7 +80,7 @@ def get_subst_vars(samdb):
vars['NTDSGUID'] = samdb.get_ntds_GUID()
res = samdb.search(base=samdb.get_default_basedn(), scope=ldb.SCOPE_BASE, attrs=["objectGUID"])
guid = samdb.schema_format_value("objectGUID", res[0]['objectGUID'][0])
vars['DOMAINGUID'] = guid
vars['DOMAINGUID'] = get_string(guid)
return vars
try: