1 Star 0 Fork 49

lauyarn/samba

forked from src-openEuler/samba 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0013-CVE-2023-4154.patch 3.33 KB
一键复制 编辑 原始数据 按行查看 历史
From 87ff4f57bf7a1980f2f6299115e35ab12483a150 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <[email protected]>
Date: Mon, 7 Aug 2023 13:15:40 +1200
Subject: [PATCH 18/28] CVE-2023-4154 dsdb/tests: Use self.addCleanup() and
delete_force()
Thie helps ensure this test is reliable even in spite of errors while
running.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15424
Signed-off-by: Andrew Bartlett <[email protected]>
Conflict: NA
Reference: https://download.samba.org/pub/samba/patches/security/samba-4.18.8-security-2023-10-10.patch
[PATCH 18/28] CVE-2023-4154 dsdb/tests: Use self.addCleanup() and
delete_force()
---
source4/dsdb/tests/python/confidential_attr.py | 6 ++----
source4/dsdb/tests/python/dirsync.py | 6 +-----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/source4/dsdb/tests/python/confidential_attr.py b/source4/dsdb/tests/python/confidential_attr.py
index 8ca56bd1023..3997848f8f9 100755
--- a/source4/dsdb/tests/python/confidential_attr.py
+++ b/source4/dsdb/tests/python/confidential_attr.py
@@ -98,7 +98,9 @@ class ConfidentialAttrCommon(samba.tests.TestCase):
userou = "OU=conf-attr-test"
self.ou = "{0},{1}".format(userou, self.base_dn)
+ samba.tests.delete_force(self.ldb_admin, self.ou, controls=['tree_delete:1'])
self.ldb_admin.create_ou(self.ou)
+ self.addCleanup(samba.tests.delete_force, self.ldb_admin, self.ou, controls=['tree_delete:1'])
# use a common username prefix, so we can use sAMAccountName=CATC-* as
# a search filter to only return the users we're interested in
@@ -139,10 +141,6 @@ class ConfidentialAttrCommon(samba.tests.TestCase):
"{0} searchFlags already {1}".format(self.conf_attr,
search_flags))
- def tearDown(self):
- super(ConfidentialAttrCommon, self).tearDown()
- self.ldb_admin.delete(self.ou, ["tree_delete:1"])
-
def add_attr(self, dn, attr, value):
m = Message()
m.dn = Dn(self.ldb_admin, dn)
diff --git a/source4/dsdb/tests/python/dirsync.py b/source4/dsdb/tests/python/dirsync.py
index ad136b7efee..e06b85bc749 100755
--- a/source4/dsdb/tests/python/dirsync.py
+++ b/source4/dsdb/tests/python/dirsync.py
@@ -137,10 +137,6 @@ class SimpleDirsyncTests(DirsyncBaseTests):
if self.ouname:
delete_force(self.ldb_admin, self.ouname)
self.sd_utils.modify_sd_on_dn(self.base_dn, self.desc_sddl)
- try:
- self.ldb_admin.deletegroup("testgroup")
- except Exception:
- pass
# def test_dirsync_errors(self):
@@ -499,6 +495,7 @@ class SimpleDirsyncTests(DirsyncBaseTests):
self.assertEqual(len(res[0].get("member")), size)
self.ldb_admin.newgroup("testgroup")
+ self.addCleanup(self.ldb_admin.deletegroup, "testgroup")
self.ldb_admin.add_remove_group_members("testgroup", [self.simple_user],
add_members_operation=True)
@@ -537,7 +534,6 @@ class SimpleDirsyncTests(DirsyncBaseTests):
attrs=["member"],
controls=[control1])
- self.ldb_admin.deletegroup("testgroup")
self.assertEqual(len(res[0].get("member")), 0)
def test_dirsync_deleted_items(self):
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lauyarn/samba.git
[email protected]:lauyarn/samba.git
lauyarn
samba
samba
master

搜索帮助