f.close()
return (0, ans.strip("'"))
else:
- m = re.match('\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans)
+ m = re.match(r'\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans)
if m:
f.close()
return (int(m.group(1)), m.group(2))
res = re.search(r"D:(.*?)(\(.*\))", self.sddl).group(2)
except AttributeError:
return []
- return re.findall("(\(.*?\))", res)
+ return re.findall(r"(\(.*?\))", res)
def fix_sid(self, ace):
res = "%s" % ace
# Make sure there are inheritable ACEs initially
self.assertTrue("CI" in desc_sddl or "OI" in desc_sddl)
# Find and remove all inherit ACEs
- res = re.findall("\(.*?\)", desc_sddl)
+ res = re.findall(r"\(.*?\)", desc_sddl)
res = [x for x in res if ("CI" in x) or ("OI" in x)]
for x in res:
desc_sddl = desc_sddl.replace(x, "")
# Make sure there are inheritable ACEs initially
self.assertTrue("CI" in desc_sddl or "OI" in desc_sddl)
# Find and remove all inherit ACEs
- res = re.findall("\(.*?\)", desc_sddl)
+ res = re.findall(r"\(.*?\)", desc_sddl)
res = [x for x in res if ("CI" in x) or ("OI" in x)]
for x in res:
desc_sddl = desc_sddl.replace(x, "")
# also make sure the added above non-inheritable ACEs are absent too
desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
self.assertFalse("ID" in desc_sddl)
- for x in re.findall("\(.*?\)", mod):
+ for x in re.findall(r"\(.*?\)", mod):
self.assertFalse(x in desc_sddl)
self.sd_utils.modify_sd_on_dn(group_dn, "D:" + moded)
desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
self.assertFalse("ID" in desc_sddl)
- for x in re.findall("\(.*?\)", mod):
+ for x in re.findall(r"\(.*?\)", mod):
self.assertFalse(x in desc_sddl)
def test_203(self):