Use separate patches instead of one big libsemanage-fedora.patch
This commit is contained in:
parent
079ba207f7
commit
54aa053334
@ -0,0 +1,66 @@
|
|||||||
|
From dc105dcb5e34e256bcbcf547fea590cfcee06933 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Petr Lautrbach <plautrba@redhat.com>
|
||||||
|
Date: Wed, 7 Nov 2018 18:17:34 +0100
|
||||||
|
Subject: [PATCH] libsemanage: Fix RESOURCE_LEAK and USE_AFTER_FREE coverity
|
||||||
|
scan defects
|
||||||
|
|
||||||
|
---
|
||||||
|
libsemanage/src/direct_api.c | 21 ++++++++-------------
|
||||||
|
1 file changed, 8 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
|
||||||
|
index c58961be..8e4d116d 100644
|
||||||
|
--- a/libsemanage/src/direct_api.c
|
||||||
|
+++ b/libsemanage/src/direct_api.c
|
||||||
|
@@ -1028,7 +1028,7 @@ static int semanage_direct_write_langext(semanage_handle_t *sh,
|
||||||
|
|
||||||
|
fp = NULL;
|
||||||
|
|
||||||
|
- ret = 0;
|
||||||
|
+ return 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (fp != NULL) fclose(fp);
|
||||||
|
@@ -2177,7 +2177,6 @@ cleanup:
|
||||||
|
semanage_module_info_destroy(sh, modinfo);
|
||||||
|
free(modinfo);
|
||||||
|
|
||||||
|
- if (fp != NULL) fclose(fp);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2342,16 +2341,6 @@ static int semanage_direct_get_module_info(semanage_handle_t *sh,
|
||||||
|
free(tmp);
|
||||||
|
tmp = NULL;
|
||||||
|
|
||||||
|
- if (fclose(fp) != 0) {
|
||||||
|
- ERR(sh,
|
||||||
|
- "Unable to close %s module lang ext file.",
|
||||||
|
- (*modinfo)->name);
|
||||||
|
- status = -1;
|
||||||
|
- goto cleanup;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- fp = NULL;
|
||||||
|
-
|
||||||
|
/* lookup enabled/disabled status */
|
||||||
|
ret = semanage_module_get_path(sh,
|
||||||
|
*modinfo,
|
||||||
|
@@ -2395,7 +2384,13 @@ cleanup:
|
||||||
|
free(modinfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (fp != NULL) fclose(fp);
|
||||||
|
+ if (fp != NULL && fclose(fp) != 0) {
|
||||||
|
+ ERR(sh,
|
||||||
|
+ "Unable to close %s module lang ext file.",
|
||||||
|
+ (*modinfo)->name);
|
||||||
|
+ status = -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.23.0.rc1
|
||||||
|
|
@ -7,11 +7,9 @@ Version: 2.9
|
|||||||
Release: 2%{?dist}
|
Release: 2%{?dist}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Source0: https://github.com/SELinuxProject/selinux/releases/download/20190315/libsemanage-2.9.tar.gz
|
Source0: https://github.com/SELinuxProject/selinux/releases/download/20190315/libsemanage-2.9.tar.gz
|
||||||
# download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh
|
# fedora-selinux/selinux: git format-patch -N 20190315 -- libsemanage
|
||||||
# run:
|
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
|
||||||
# $ VERSION=2.9 ./make-fedora-selinux-patch.sh libsemanage
|
Patch0001: 0001-libsemanage-Fix-RESOURCE_LEAK-and-USE_AFTER_FREE-cov.patch
|
||||||
# HEAD https://github.com/fedora-selinux/selinux/commit/431f72836d6c02450725cf6ffb1c7223b9fa6acc
|
|
||||||
Patch1: libsemanage-fedora.patch
|
|
||||||
URL: https://github.com/SELinuxProject/selinux/wiki
|
URL: https://github.com/SELinuxProject/selinux/wiki
|
||||||
Source1: semanage.conf
|
Source1: semanage.conf
|
||||||
|
|
||||||
@ -87,7 +85,7 @@ The libsemanage-python3 package contains the python 3 bindings for developing
|
|||||||
SELinux management applications.
|
SELinux management applications.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n libsemanage-%{version} -p 1
|
%autosetup -n libsemanage-%{version} -p 2
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
Loading…
Reference in New Issue
Block a user