aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-12-16 22:03:07 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-12-16 22:03:07 +0000
commit212a9e33b40936d7c7fcbdb886c13014ed238d03 (patch)
treec893169f1c2c570ea7bcd2c1fc4e3cb65c5ce2a9
parentc3e685320315cf6d88cccaef50b6f669e6483bde (diff)
downloadaports-212a9e33b40936d7c7fcbdb886c13014ed238d03.tar.gz
aports-212a9e33b40936d7c7fcbdb886c13014ed238d03.tar.bz2
aports-212a9e33b40936d7c7fcbdb886c13014ed238d03.tar.xz
testing/libsemanage: upgrade to 2.8
-rw-r--r--testing/libsemanage/0001-libsemanage-remove-use-of-getpwent_r.patch133
-rw-r--r--testing/libsemanage/APKBUILD26
2 files changed, 15 insertions, 144 deletions
diff --git a/testing/libsemanage/0001-libsemanage-remove-use-of-getpwent_r.patch b/testing/libsemanage/0001-libsemanage-remove-use-of-getpwent_r.patch
deleted file mode 100644
index 9547e8d0d4..0000000000
--- a/testing/libsemanage/0001-libsemanage-remove-use-of-getpwent_r.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 687398b9df5a8fc2d17bd9d83e067812980ec853 Mon Sep 17 00:00:00 2001
-From: Tycho Andersen <tycho@docker.com>
-Date: Tue, 14 Mar 2017 13:57:35 -0700
-Subject: [PATCH] libsemanage: remove use of getpwent_r
-
-getpwent_r isn't really re-entrant, and the _r version is a GNU extension,
-which won't work with libcs that don't implement it. Let's just use
-getpwent instead.
-
-Signed-off-by: Tycho Andersen <tycho@docker.com>
----
- src/genhomedircon.c | 54 ++++++++++++++++++-----------------------
- 1 file changed, 24 insertions(+), 30 deletions(-)
-
-diff --git a/src/genhomedircon.c b/libsemanage/src/genhomedircon.c
-index 465dd88..839280b 100644
---- a/src/genhomedircon.c
-+++ b/src/genhomedircon.c
-@@ -290,14 +290,11 @@ static semanage_list_t *get_home_dirs(genhomedircon_settings_t * s)
- semanage_list_t *homedir_list = NULL;
- semanage_list_t *shells = NULL;
- fc_match_handle_t hand;
-- char *rbuf = NULL;
- char *path = NULL;
-- long rbuflen;
- uid_t temp, minuid = 500, maxuid = 60000;
- int minuid_set = 0;
-- struct passwd pwstorage, *pwbuf;
-+ struct passwd *pwbuf;
- struct stat buf;
-- int retval;
-
- path = semanage_findval(PATH_ETC_USERADD, "HOME", "=");
- if (path && *path) {
-@@ -362,14 +359,18 @@ static semanage_list_t *get_home_dirs(genhomedircon_settings_t * s)
- free(path);
- path = NULL;
-
-- rbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-- if (rbuflen <= 0)
-- goto fail;
-- rbuf = malloc(rbuflen);
-- if (rbuf == NULL)
-- goto fail;
- setpwent();
-- while ((retval = getpwent_r(&pwstorage, rbuf, rbuflen, &pwbuf)) == 0) {
-+ while (1) {
-+ errno = 0;
-+ pwbuf = getpwent();
-+ if (!pwbuf) {
-+ if (errno) {
-+ WARN(s->h_semanage, "Error while fetching users. "
-+ "Returning list so far.");
-+ }
-+ break;
-+ }
-+
- if (pwbuf->pw_uid < minuid || pwbuf->pw_uid > maxuid)
- continue;
- if (!semanage_list_find(shells, pwbuf->pw_shell))
-@@ -413,23 +414,16 @@ static semanage_list_t *get_home_dirs(genhomedircon_settings_t * s)
- path = NULL;
- }
-
-- if (retval && retval != ENOENT) {
-- WARN(s->h_semanage, "Error while fetching users. "
-- "Returning list so far.");
-- }
--
- if (semanage_list_sort(&homedir_list))
- goto fail;
-
- endpwent();
-- free(rbuf);
- semanage_list_destroy(&shells);
-
- return homedir_list;
-
- fail:
- endpwent();
-- free(rbuf);
- free(path);
- semanage_list_destroy(&homedir_list);
- semanage_list_destroy(&shells);
-@@ -1063,9 +1057,7 @@ static int get_group_users(genhomedircon_settings_t * s,
- char *grbuf = NULL;
- struct group grstorage, *group = NULL;
-
-- long prbuflen;
-- char *pwbuf = NULL;
-- struct passwd pwstorage, *pw = NULL;
-+ struct passwd *pw = NULL;
-
- grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- if (grbuflen <= 0)
-@@ -1102,15 +1094,18 @@ static int get_group_users(genhomedircon_settings_t * s,
- }
- }
-
-- prbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-- if (prbuflen <= 0)
-- goto cleanup;
-- pwbuf = malloc(prbuflen);
-- if (pwbuf == NULL)
-- goto cleanup;
--
- setpwent();
-- while ((retval = getpwent_r(&pwstorage, pwbuf, prbuflen, &pw)) == 0) {
-+ while (1) {
-+ errno = 0;
-+ pw = getpwent();
-+ if (!pw) {
-+ if (errno) {
-+ WARN(s->h_semanage, "Error while fetching groups. "
-+ "Returning list so far.");
-+ }
-+ break;
-+ }
-+
- // skip users who also have this group as their
- // primary group
- if (lfind(pw->pw_name, group->gr_mem, &nmembers,
-@@ -1129,7 +1124,6 @@ static int get_group_users(genhomedircon_settings_t * s,
- retval = STATUS_SUCCESS;
- cleanup:
- endpwent();
-- free(pwbuf);
- free(grbuf);
-
- return retval;
---
-2.9.3
-
diff --git a/testing/libsemanage/APKBUILD b/testing/libsemanage/APKBUILD
index c2f7ea163b..e7196a8393 100644
--- a/testing/libsemanage/APKBUILD
+++ b/testing/libsemanage/APKBUILD
@@ -1,30 +1,34 @@
# Contributor: Tycho Andersen <tycho@docker.com>
# Maintainer: Tycho Andersen <tycho@docker.com>
pkgname=libsemanage
-pkgver=2.6
+pkgver=2.8
pkgrel=0
pkgdesc="SELinux binary policy manipulation library"
url="https://github.com/SELinuxProject/selinux/wiki"
arch="all"
license="LGPL-2.0-or-later"
-depends=""
-depends_dev=""
-makedepends="$depends_dev libselinux-dev libsepol-dev bzip2-dev ustr-dev bison flex audit-dev"
-install=""
+makedepends="
+ libselinux-dev
+ libsepol-dev
+ bzip2-dev
+ audit-dev
+
+ bison
+ flex
+ python
+ "
subpackages="$pkgname-dev $pkgname-doc"
-source="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/libsemanage-$pkgver.tar.gz
- 0001-libsemanage-remove-use-of-getpwent_r.patch"
+source="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/libsemanage-$pkgver.tar.gz"
builddir="$srcdir/libsemanage-$pkgver"
build() {
cd "$builddir"
- make || return 1
+ make
}
package() {
cd "$builddir"
- make DESTDIR="$pkgdir" install || return 1
+ make DESTDIR="$pkgdir" install
}
-sha512sums="38741d6e6f7a2669bfeee362e42d6bfd720cceeaf61331e329b2210fdc070444e529656ce86dd82e94aa248eafcfaea4c5d013d9cce76c1039be6fc6a6b2c790 libsemanage-2.6.tar.gz
-ef5040bc015673266fc46284a8dc84b3316d6dd7bcc3a2c4ba4dd6e2d35a0d0c6984e72648c60739e4d97570941b7da07a6a2c98959c3b446bc0cae706d23441 0001-libsemanage-remove-use-of-getpwent_r.patch"
+sha512sums="53f09c79da168a79b853f55e0f1c20a96229df9d82929c514bcaf72697446ae836f7f0457fc0056d2418cc6d0712157faf0152881518fe84a1b1b9b9af17e7ef libsemanage-2.8.tar.gz"