From 3b840f4d3dbd4d7e6d8746bc6eced9b33a244367 Mon Sep 17 00:00:00 2001 From: chili-b Date: Fri, 29 Jul 2022 12:46:03 -0400 Subject: [PATCH] libcgroup: update to 2.0.2. --- common/shlibs | 2 +- .../libcgroup/patches/CVE-2018-14348.patch | 12 ------ .../patches/api.c-fix-infinite-loop.patch | 38 ------------------- srcpkgs/libcgroup/patches/musl-decls.patch | 22 ----------- .../libcgroup/patches/musl-strerror_r.patch | 22 ----------- srcpkgs/libcgroup/template | 23 ++++------- 6 files changed, 9 insertions(+), 110 deletions(-) delete mode 100644 srcpkgs/libcgroup/patches/CVE-2018-14348.patch delete mode 100644 srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch delete mode 100644 srcpkgs/libcgroup/patches/musl-decls.patch delete mode 100644 srcpkgs/libcgroup/patches/musl-strerror_r.patch diff --git a/common/shlibs b/common/shlibs index 221b8b705452..dbf29ad54ca2 100644 --- a/common/shlibs +++ b/common/shlibs @@ -963,7 +963,7 @@ libIceDiscovery.so.37 libIce-3.7.5_2 libIceLocatorDiscovery.so.37 libIce-3.7.5_2 libvdpau.so.1 libvdpau-0.4.1_1 libgsm.so.1 libgsm-1.0.13_13 -libcgroup.so.1 libcgroup-0.37.1_1 +libcgroup.so.2 libcgroup-2.0.2_1 libxdg-basedir.so.1 libxdg-basedir-1.1.1_1 libev.so.4 libev-4.04_1 libell.so.0 ell-0.45_1 diff --git a/srcpkgs/libcgroup/patches/CVE-2018-14348.patch b/srcpkgs/libcgroup/patches/CVE-2018-14348.patch deleted file mode 100644 index bd083c2aad97..000000000000 --- a/srcpkgs/libcgroup/patches/CVE-2018-14348.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/daemon/cgrulesengd.c -+++ b/src/daemon/cgrulesengd.c -@@ -889,9 +889,6 @@ - } else if (pid > 0) { - exit(EXIT_SUCCESS); - } -- -- /* Change the file mode mask. */ -- umask(0); - } else { - flog(LOG_DEBUG, "Not using daemon mode\n"); - pid = getpid(); diff --git a/srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch b/srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch deleted file mode 100644 index 12ee0eeebc84..000000000000 --- a/srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch +++ /dev/null @@ -1,38 +0,0 @@ -Date: Tue, 8 Dec 2015 16:53:41 +0100 -Subject: [PATCH] api.c: fix infinite loop - -If getgrnam or getpwuid functions failed, the program entered -an infinite loop, because the rule pointer was never advanced. -This is now fixed by updating the pointer before continuing -to the next iteration. ---- - src/api.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/api.c b/src/api.c -index d6c9d3a..ef796ac 100644 ---- a/src/api.c -+++ b/src/api.c -@@ -2775,13 +2775,17 @@ static struct cgroup_rule *cgroup_find_matching_rule_uid_gid(uid_t uid, - /* Get the group data. */ - sp = &(rule->username[1]); - grp = getgrnam(sp); -- if (!grp) -+ if (!grp) { -+ rule = rule->next; - continue; -+ } - - /* Get the data for UID. */ - usr = getpwuid(uid); -- if (!usr) -+ if (!usr) { -+ rule = rule->next; - continue; -+ } - - /* If UID is a member of group, we matched. */ - for (i = 0; grp->gr_mem[i]; i++) { --- -2.10.2 - diff --git a/srcpkgs/libcgroup/patches/musl-decls.patch b/srcpkgs/libcgroup/patches/musl-decls.patch deleted file mode 100644 index eacf4e618d93..000000000000 --- a/srcpkgs/libcgroup/patches/musl-decls.patch +++ /dev/null @@ -1,22 +0,0 @@ -In musl libc these macros are defined in the deprecated -include file sys/cdefs.h - ---- a/include/libcgroup.h 2014-01-13 15:05:56.000000000 +0100 -+++ b/include/libcgroup.h 2015-10-25 14:03:32.921207668 +0100 -@@ -16,6 +16,16 @@ - #ifndef _LIBCGROUP_H - #define _LIBCGROUP_H - -+#if !defined(__GLIBC__) -+#ifdef __cplusplus -+# define __BEGIN_DECLS extern "C" { -+# define __END_DECLS } -+#else -+# define __BEGIN_DECLS -+# define __END_DECLS -+#endif -+#endif /* !defined(__GLIBC__) */ -+ - #define _LIBCGROUP_H_INSIDE - - #include diff --git a/srcpkgs/libcgroup/patches/musl-strerror_r.patch b/srcpkgs/libcgroup/patches/musl-strerror_r.patch deleted file mode 100644 index 0f54e12b05d2..000000000000 --- a/srcpkgs/libcgroup/patches/musl-strerror_r.patch +++ /dev/null @@ -1,22 +0,0 @@ -The musl libc strerror_r(3) semantics are different from -GNU libc's if _GNU_SOURCE is defined. - ---- a/src/api.c 2014-01-13 15:05:56.000000000 +0100 -+++ b/src/api.c 2015-10-25 14:09:18.690232596 +0100 -@@ -3332,8 +3332,16 @@ - - const char *cgroup_strerror(int code) - { -+#if defined(__GLIBC__) - if (code == ECGOTHER) - return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); -+#else -+ if (code == ECGOTHER) { -+ if (0 == strerror_r(cgroup_get_last_errno(), errtext, MAXLEN)) -+ return errtext; -+ return "strerror_r() failed"; -+ } -+#endif - - return cgroup_strerror_codes[code % ECGROUPNOTCOMPILED]; - } diff --git a/srcpkgs/libcgroup/template b/srcpkgs/libcgroup/template index c9c19120e597..e920e6fd6c6f 100644 --- a/srcpkgs/libcgroup/template +++ b/srcpkgs/libcgroup/template @@ -1,17 +1,18 @@ # Template file for 'libcgroup' pkgname=libcgroup -version=0.41 -revision=8 +version=2.0.2 +revision=1 build_style=gnu-configure configure_args="--sbindir=/usr/bin --enable-pam-module-dir=/usr/lib/security" -hostmakedepends="flex automake libtool" +hostmakedepends="flex" makedepends="pam-devel" short_desc="Library that abstracts the control group file system in Linux" maintainer="Orphaned " -license="LGPL-2.1" -homepage="http://libcg.sourceforge.net" -distfiles="${SOURCEFORGE_SITE}/libcg/${pkgname}-${version}.tar.bz2" -checksum=e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51 +make_dirs="/etc/cgconfig.d 0755 root root" +license="LGPL-2.1-only" +homepage="https://github.com/libcgroup/libcgroup" +distfiles="https://github.com/libcgroup/libcgroup/releases/download/v${version}/libcgroup-${version}.tar.gz" +checksum=8ef63b32e0aff619547dbb8a25e1f6bab152d7c4864795cf915571a5994d0cf8 case "$XBPS_TARGET_MACHINE" in *-musl) # Add musl-fts implementation @@ -20,14 +21,6 @@ case "$XBPS_TARGET_MACHINE" in ;; esac -pre_configure() { - autoreconf -if -} -post_configure() { - # Disable tests - sed -i Makefile -e "/SUBDIRS =/ s; tests;;" -} - libcgroup-utils_package() { short_desc+=" - utilities" conf_files="/etc/cgrules.conf /etc/cgconfig.conf"