!69 [sync] PR-68: backport patches from upstream
From: @openeuler-sync-bot Reviewed-by: @HuaxinLuGitee Signed-off-by: @HuaxinLuGitee
This commit is contained in:
commit
b2bf79b9e3
35
backport-python-Use-isinstance-instead-of-type.patch
Normal file
35
backport-python-Use-isinstance-instead-of-type.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From f6dc6acfa00707ce25c6357169111937f12512dd Mon Sep 17 00:00:00 2001
|
||||||
|
From: James Carter <jwcart2@gmail.com>
|
||||||
|
Date: Thu, 3 Aug 2023 09:40:24 -0400
|
||||||
|
Subject: [PATCH] python: Use isinstance() instead of type()
|
||||||
|
|
||||||
|
CI testing fails while running flake8 on python scripts with the
|
||||||
|
message "./python/semanage/seobject.py:250:16: E721 do not compare
|
||||||
|
types, for exact checks use `is` / `is not`, for instance checks use
|
||||||
|
`isinstance()`"
|
||||||
|
|
||||||
|
Use "isinstance(args, str)" instead of "type(args) == str"
|
||||||
|
|
||||||
|
Signed-off-by: James Carter <jwcart2@gmail.com>
|
||||||
|
|
||||||
|
Reference:https://github.com/SELinuxProject/selinux/commit/f6dc6acfa00707ce25c6357169111937f12512dd
|
||||||
|
Conflict:NA
|
||||||
|
---
|
||||||
|
python/semanage/seobject.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
|
||||||
|
index 361205d1..cc944ae2 100644
|
||||||
|
--- a/python/semanage/seobject.py
|
||||||
|
+++ b/python/semanage/seobject.py
|
||||||
|
@@ -247,7 +247,7 @@ class semanageRecords:
|
||||||
|
global handle
|
||||||
|
if args:
|
||||||
|
# legacy code - args was store originally
|
||||||
|
- if type(args) == str:
|
||||||
|
+ if isinstance(args, str):
|
||||||
|
self.store = args
|
||||||
|
else:
|
||||||
|
self.args = args
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
From 8730e0762e36ae214932e2a2a84aedd573462357 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Huaxin Lu <luhuaxin1@huawei.com>
|
||||||
|
Date: Tue, 11 Jul 2023 06:49:33 +0800
|
||||||
|
Subject: [PATCH] restorecond: add check for strdup in strings_list_add
|
||||||
|
|
||||||
|
Check the return value of strdup() to avoid null pointer reference.
|
||||||
|
|
||||||
|
Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
|
||||||
|
Acked-by: James Carter <jwcart2@gmail.com>
|
||||||
|
|
||||||
|
Reference:https://github.com/SELinuxProject/selinux/commit/8730e0762e36ae214932e2a2a84aedd573462357
|
||||||
|
Conflict:NA
|
||||||
|
---
|
||||||
|
restorecond/stringslist.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/restorecond/stringslist.c b/restorecond/stringslist.c
|
||||||
|
index f9404b1e..a76542a7 100644
|
||||||
|
--- a/restorecond/stringslist.c
|
||||||
|
+++ b/restorecond/stringslist.c
|
||||||
|
@@ -48,6 +48,8 @@ void strings_list_add(struct stringsList **list, const char *string)
|
||||||
|
if (!newptr)
|
||||||
|
exitApp("Out of Memory");
|
||||||
|
newptr->string = strdup(string);
|
||||||
|
+ if (!newptr->string)
|
||||||
|
+ exitApp("Out of Memory");
|
||||||
|
newptr->next = ptr;
|
||||||
|
if (prev)
|
||||||
|
prev->next = newptr;
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: policycoreutils
|
Name: policycoreutils
|
||||||
Version: 3.3
|
Version: 3.3
|
||||||
Release: 6
|
Release: 7
|
||||||
Summary: Policy core utilities of selinux
|
Summary: Policy core utilities of selinux
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: https://github.com/SELinuxProject
|
URL: https://github.com/SELinuxProject
|
||||||
@ -29,6 +29,8 @@ Patch6008: backport-sepolicy-Call-os.makedirs-with-exist_ok-True.patch
|
|||||||
Patch6009: backport-policycoreutils-fix-potential-NULL-reference-in-load_checks.patch
|
Patch6009: backport-policycoreutils-fix-potential-NULL-reference-in-load_checks.patch
|
||||||
Patch6010: backport-python-sepolicy-add-missing-booleans-to-man-pages.patch
|
Patch6010: backport-python-sepolicy-add-missing-booleans-to-man-pages.patch
|
||||||
Patch6011: backport-python-sepolicy-Cache-conditional-rule-queries.patch
|
Patch6011: backport-python-sepolicy-Cache-conditional-rule-queries.patch
|
||||||
|
Patch6012: backport-restorecond-add-check-for-strdup-in-strings_list_add.patch
|
||||||
|
Patch6013: backport-python-Use-isinstance-instead-of-type.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: pam-devel libsepol-static >= 3.3 libsemanage-static >= 3.3 libselinux-devel >= 3.3 libcap-devel audit-libs-devel gettext
|
BuildRequires: pam-devel libsepol-static >= 3.3 libsemanage-static >= 3.3 libselinux-devel >= 3.3 libcap-devel audit-libs-devel gettext
|
||||||
@ -269,6 +271,9 @@ find %{buildroot}%{python3_sitelib} %{buildroot}%{python3_sitearch} \
|
|||||||
%{_mandir}/*
|
%{_mandir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Sep 11 2023 zhangguangzhi <zhangguangzhi3@huawei.com> -3.3-7
|
||||||
|
- backport patches from upstream
|
||||||
|
|
||||||
* Wed Mar 22 2023 zhangguangzhi <zhangguangzhi3@huawei.com> -3.3-6
|
* Wed Mar 22 2023 zhangguangzhi <zhangguangzhi3@huawei.com> -3.3-6
|
||||||
- backport patches from upstream
|
- backport patches from upstream
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user