Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libsemanage.git#814f77e6dd797065712c693573795e76b3fc767b
This commit is contained in:
DistroBaker 2021-01-21 17:50:10 +00:00
parent 5c0aba8b81
commit b2c429751a
6 changed files with 19 additions and 164 deletions

1
.gitignore vendored
View File

@ -146,3 +146,4 @@ libsemanage-2.0.45.tgz
/libsemanage-3.0-rc1.tar.gz
/libsemanage-3.0.tar.gz
/libsemanage-3.1.tar.gz
/libsemanage-3.2-rc1.tar.gz

View File

@ -1,4 +1,4 @@
From fc966a746653cc15a14d1e1a80f01fc2f567ee08 Mon Sep 17 00:00:00 2001
From 20d75ec7c77c9c74d51d714db384b322b13fc731 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
@ -9,7 +9,7 @@ Subject: [PATCH] libsemanage: Fix RESOURCE_LEAK and USE_AFTER_FREE coverity
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
index d2b91fb24292..f445cd4d6fb5 100644
index 9a4e79385b69..393ec9faf92d 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,
@ -21,7 +21,7 @@ index d2b91fb24292..f445cd4d6fb5 100644
cleanup:
if (fp != NULL) fclose(fp);
@@ -2184,7 +2184,6 @@ cleanup:
@@ -2185,7 +2185,6 @@ cleanup:
semanage_module_info_destroy(sh, modinfo);
free(modinfo);
@ -29,7 +29,7 @@ index d2b91fb24292..f445cd4d6fb5 100644
return status;
}
@@ -2349,16 +2348,6 @@ static int semanage_direct_get_module_info(semanage_handle_t *sh,
@@ -2350,16 +2349,6 @@ static int semanage_direct_get_module_info(semanage_handle_t *sh,
free(tmp);
tmp = NULL;
@ -46,7 +46,7 @@ index d2b91fb24292..f445cd4d6fb5 100644
/* lookup enabled/disabled status */
ret = semanage_module_get_path(sh,
*modinfo,
@@ -2402,7 +2391,13 @@ cleanup:
@@ -2403,7 +2392,13 @@ cleanup:
free(modinfos);
}
@ -62,5 +62,5 @@ index d2b91fb24292..f445cd4d6fb5 100644
}
--
2.29.0
2.30.0

View File

@ -1,100 +0,0 @@
From c08b73d7183e2dbab0ba43c3df32f4214abbc9c6 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Fri, 9 Oct 2020 15:00:51 +0200
Subject: [PATCH] libsemanage: Drop deprecated functions
semanage_module_enable() and semanage_module_disable() were deprecated
by commit 9fbc6d14418f ("libsemanage: add back original module
enable/disable functions for ABI compatability") in 2014 in order to
preserve ABI compatibility. As we the libsemanage ABI is changed by the
previous commit, it makes sense to drop them completely.
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
libsemanage/src/libsemanage.map | 2 --
libsemanage/src/modules.c | 56 ---------------------------------
2 files changed, 58 deletions(-)
diff --git a/libsemanage/src/libsemanage.map b/libsemanage/src/libsemanage.map
index 4bec06aaae27..3ea7b60f97bb 100644
--- a/libsemanage/src/libsemanage.map
+++ b/libsemanage/src/libsemanage.map
@@ -165,8 +165,6 @@ LIBSEMANAGE_1.0 {
semanage_is_connected;
semanage_is_managed;
semanage_mls_enabled;
- semanage_module_disable;
- semanage_module_enable;
semanage_module_get_name;
semanage_module_get_version;
semanage_module_info_datum_destroy;
diff --git a/libsemanage/src/modules.c b/libsemanage/src/modules.c
index 8b36801038df..b6dd456cac32 100644
--- a/libsemanage/src/modules.c
+++ b/libsemanage/src/modules.c
@@ -734,62 +734,6 @@ int semanage_module_set_enabled(semanage_handle_t *sh,
}
-/* This function exists only for ABI compatibility. It has been deprecated and
- * should not be used. Instead, use semanage_module_set_enabled() */
-int semanage_module_enable(semanage_handle_t *sh, char *module_name)
-{
- int rc = -1;
- semanage_module_key_t *modkey = NULL;
-
- rc = semanage_module_key_create(sh, &modkey);
- if (rc != 0)
- goto exit;
-
- rc = semanage_module_key_set_name(sh, modkey, module_name);
- if (rc != 0)
- goto exit;
-
- rc = semanage_module_set_enabled(sh, modkey, 1);
- if (rc != 0)
- goto exit;
-
- rc = 0;
-
-exit:
- semanage_module_key_destroy(sh, modkey);
- free(modkey);
-
- return rc;
-}
-
-/* This function exists only for ABI compatibility. It has been deprecated and
- * should not be used. Instead, use semanage_module_set_enabled() */
-int semanage_module_disable(semanage_handle_t *sh, char *module_name)
-{
- int rc = -1;
- semanage_module_key_t *modkey = NULL;
-
- rc = semanage_module_key_create(sh, &modkey);
- if (rc != 0)
- goto exit;
-
- rc = semanage_module_key_set_name(sh, modkey, module_name);
- if (rc != 0)
- goto exit;
-
- rc = semanage_module_set_enabled(sh, modkey, 0);
- if (rc != 0)
- goto exit;
-
- rc = 0;
-
-exit:
- semanage_module_key_destroy(sh, modkey);
- free(modkey);
-
- return rc;
-}
-
/* Converts a string to a priority
*
* returns -1 if str is not a valid priority.
--
2.29.0

View File

@ -1,45 +0,0 @@
From 6ebb35d261eaa8701b53b9f68184b05de8dfd868 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Fri, 9 Oct 2020 15:00:52 +0200
Subject: [PATCH] libsemanage: Bump libsemanage.so version
Previous commits removed some symbols and broke ABI, therefore we need to change
SONAME.
See the following quotes from distribution guidelines:
https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#run-time-shared-libraries
Every time the shared library ABI changes in a way that may break
binaries linked against older versions of the shared library, the SONAME
of the library and the corresponding name for the binary package
containing the runtime shared library should change.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_downstream_so_name_versioning
When new versions of the library are released, you should use an ABI
comparison tool to check for ABI differences in the built shared
libraries. If it detects any incompatibilities, bump the n number by
one.
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
libsemanage/src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
index a0eb3747d74b..ab6cae51f5c3 100644
--- a/libsemanage/src/Makefile
+++ b/libsemanage/src/Makefile
@@ -32,7 +32,7 @@ YACC = bison
YFLAGS = -d
VERSION = $(shell cat ../VERSION)
-LIBVERSION = 1
+LIBVERSION = 2
LIBA=libsemanage.a
TARGET=libsemanage.so
--
2.29.0

View File

@ -1,19 +1,16 @@
%define libsepolver 3.1-5
%define libselinuxver 3.1-5
%define libsepolver 3.2-0.rc1
%define libselinuxver 3.2-0.rc1
Summary: SELinux binary policy manipulation library
Name: libsemanage
Version: 3.1
Release: 6%{?dist}
Version: 3.2
Release: 0.rc1.1%{?dist}
License: LGPLv2+
Source0: https://github.com/SELinuxProject/selinux/releases/download/20200710/libsemanage-3.1.tar.gz
Source0: https://github.com/SELinuxProject/selinux/releases/download/3.2-rc1/libsemanage-3.2-rc1.tar.gz
# fedora-selinux/selinux: git format-patch -N libsemanage-3.1 -- libsemanage
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
# Patch list start
Patch0001: 0001-libsemanage-Remove-legacy-and-duplicate-symbols.patch
Patch0002: 0002-libsemanage-Drop-deprecated-functions.patch
Patch0003: 0003-libsemanage-Bump-libsemanage.so-version.patch
Patch0004: 0004-libsemanage-Fix-RESOURCE_LEAK-and-USE_AFTER_FREE-cov.patch
Patch0001: 0001-libsemanage-Fix-RESOURCE_LEAK-and-USE_AFTER_FREE-cov.patch
# Patch list end
URL: https://github.com/SELinuxProject/selinux/wiki
Source1: semanage.conf
@ -78,7 +75,7 @@ The libsemanage-python3 package contains the python 3 bindings for developing
SELinux management applications.
%prep
%autosetup -n libsemanage-%{version} -p 2
%autosetup -n libsemanage-%{version}-rc1 -p 2
%build
@ -125,10 +122,9 @@ InstallPythonWrapper \
%{__python3} \
$(python3-config --extension-suffix)
cp %{SOURCE1} ${RPM_BUILD_ROOT}/etc/selinux/semanage.conf
cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/selinux/semanage.conf
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%dir %{_sysconfdir}/selinux
%config(noreplace) %{_sysconfdir}/selinux/semanage.conf
@ -158,6 +154,9 @@ cp %{SOURCE1} ${RPM_BUILD_ROOT}/etc/selinux/semanage.conf
%{_libexecdir}/selinux/semanage_migrate_store
%changelog
* Wed Jan 20 2021 Petr Lautrbach <plautrba@redhat.com> - 3.2-0.rc1.1
- SELinux userspace 3.2-rc1 release
* Fri Dec 18 2020 Petr Lautrbach <plautrba@redhat.com> - 3.1-6
- Drop "genhomedircon: check usepasswd" patch
- genhomedircon to ignore

View File

@ -1 +1 @@
SHA512 (libsemanage-3.1.tar.gz) = 8609ca7d13b5c603677740f2b14558fea3922624af182d20d618237ba11fcf2559fab82fc68d1efa6ff118f064d426f005138521652c761de92cd66150102197
SHA512 (libsemanage-3.2-rc1.tar.gz) = 854758bc10944c994c2cc5a2dd0ce036f273e258a66ce419324348f22a2040a7fce7bcda6e9a8d185e4c8671bd7b4723f1b537738ea392b6cb9e5246fcd655db