summaryrefslogtreecommitdiff
path: root/python/samba/netcmd
diff options
context:
space:
mode:
Diffstat (limited to 'python/samba/netcmd')
-rw-r--r--python/samba/netcmd/drs.py2
-rw-r--r--python/samba/netcmd/dsacl.py4
-rw-r--r--python/samba/netcmd/gpo.py16
-rw-r--r--python/samba/netcmd/ldapcmp.py6
4 files changed, 14 insertions, 14 deletions
diff --git a/python/samba/netcmd/drs.py b/python/samba/netcmd/drs.py
index 9d6e8087e87..cebcca5f489 100644
--- a/python/samba/netcmd/drs.py
+++ b/python/samba/netcmd/drs.py
@@ -156,7 +156,7 @@ class cmd_drs_showrepl(Command):
raise
try:
(site, server) = drs_parse_ntds_dn(n.source_dsa_obj_dn)
- d["DSA"] = "%s\%s" % (site, server)
+ d["DSA"] = "%s\\%s" % (site, server)
except RuntimeError:
pass
return d
diff --git a/python/samba/netcmd/dsacl.py b/python/samba/netcmd/dsacl.py
index 92570760d40..d3b8b5f554e 100644
--- a/python/samba/netcmd/dsacl.py
+++ b/python/samba/netcmd/dsacl.py
@@ -114,11 +114,11 @@ class cmd_dsacl_set(Command):
"""Add new ace explicitly."""
desc = self.read_descriptor(samdb, object_dn)
new_ace = security.descriptor.from_sddl("D:" + new_ace,self.get_domain_sid(samdb))
- new_ace_list = re.findall("\(.*?\)",new_ace.as_sddl())
+ new_ace_list = re.findall(r"\(.*?\)",new_ace.as_sddl())
for new_ace in new_ace_list:
desc_sddl = desc.as_sddl(self.get_domain_sid(samdb))
# TODO add bindings for descriptor manipulation and get rid of this
- desc_aces = re.findall("\(.*?\)", desc_sddl)
+ desc_aces = re.findall(r"\(.*?\)", desc_sddl)
for ace in desc_aces:
if ("ID" in ace):
desc_sddl = desc_sddl.replace(ace, "")
diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py
index 76ba9fa18a9..a210922da01 100644
--- a/python/samba/netcmd/gpo.py
+++ b/python/samba/netcmd/gpo.py
@@ -248,29 +248,29 @@ def parse_unc(unc):
def find_parser(name, flags=re.IGNORECASE):
- if re.match('fdeploy1\.ini$', name, flags=flags):
+ if re.match(r'fdeploy1\.ini$', name, flags=flags):
return GPFDeploy1IniParser()
- if re.match('audit\.csv$', name, flags=flags):
+ if re.match(r'audit\.csv$', name, flags=flags):
return GPAuditCsvParser()
- if re.match('GptTmpl\.inf$', name, flags=flags):
+ if re.match(r'GptTmpl\.inf$', name, flags=flags):
return GptTmplInfParser()
- if re.match('GPT\.INI$', name, flags=flags):
+ if re.match(r'GPT\.INI$', name, flags=flags):
return GPTIniParser()
if re.match('scripts.ini$', name, flags=flags):
return GPScriptsIniParser()
if re.match('psscripts.ini$', name, flags=flags):
return GPScriptsIniParser()
- if re.match('GPE\.INI$', name, flags=flags):
+ if re.match(r'GPE\.INI$', name, flags=flags):
# This file does not appear in the protocol specifications!
#
# It appears to be a legacy file used to maintain gPCUserExtensionNames
# and gPCMachineExtensionNames. We should just copy the file as binary.
return GPParser()
- if re.match('.*\.ini$', name, flags=flags):
+ if re.match(r'.*\.ini$', name, flags=flags):
return GPIniParser()
- if re.match('.*\.pol$', name, flags=flags):
+ if re.match(r'.*\.pol$', name, flags=flags):
return GPPolParser()
- if re.match('.*\.aas$', name, flags=flags):
+ if re.match(r'.*\.aas$', name, flags=flags):
return GPAasParser()
return GPParser()
diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py
index 6051b55b31a..1d830e3082f 100644
--- a/python/samba/netcmd/ldapcmp.py
+++ b/python/samba/netcmd/ldapcmp.py
@@ -37,7 +37,7 @@ from samba.netcmd import (
Option,
)
-RE_RANGED_RESULT = re.compile("^([^;]+);range=(\d+)-(\d+|\*)$")
+RE_RANGED_RESULT = re.compile(r"^([^;]+);range=(\d+)-(\d+|\*)$")
class LDAPBase(object):
@@ -274,9 +274,9 @@ class Descriptor(object):
"""
try:
if "S:" in self.sddl:
- res = re.search("D:(.*?)(\(.*?\))S:", self.sddl).group(2)
+ res = re.search(r"D:(.*?)(\(.*?\))S:", self.sddl).group(2)
else:
- res = re.search("D:(.*?)(\(.*\))", self.sddl).group(2)
+ res = re.search(r"D:(.*?)(\(.*\))", self.sddl).group(2)
except AttributeError:
return []
return re.findall("(\(.*?\))", res)