From 6b43f5ee66c15266e71a8d6643381de14548a7df 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 +- .../patches/0001-Disable-tests.patch | 49 +++++++++++++++++++ .../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 | 17 +++---- 7 files changed, 57 insertions(+), 105 deletions(-) create mode 100644 srcpkgs/libcgroup/patches/0001-Disable-tests.patch 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/0001-Disable-tests.patch b/srcpkgs/libcgroup/patches/0001-Disable-tests.patch new file mode 100644 index 000000000000..8fc506182621 --- /dev/null +++ b/srcpkgs/libcgroup/patches/0001-Disable-tests.patch @@ -0,0 +1,49 @@ +From 95a93c57e43f44e7b45d87c43a201e149bb4c35e Mon Sep 17 00:00:00 2001 +From: Dexter Gaon-Shatford +Date: Fri, 29 Jul 2022 12:26:49 -0400 +Subject: [PATCH] Disable tests + +This is a temporary work-around. A commit which resolves the need for +this change will be included in the next release. + +see: https://github.com/libcgroup/libcgroup/commit/17b3a2d612cc8747dcf916b0cf29775cc88f4a23 +--- + Makefile.am | 2 +- + configure.ac | 9 --------- + 2 files changed, 1 insertion(+), 10 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index e87ec8a..a3e8dcf 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + AUTOMAKE_OPTIONS = foreign + ACLOCAL_AMFLAGS= -I m4 +-SUBDIRS = dist doc include samples scripts src tests ++SUBDIRS = dist doc include samples scripts src + + EXTRA_DIST = README_daemon libcgroup.doxyfile README_systemd + +diff --git a/configure.ac b/configure.ac +index 1bcf8a0..509f21e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -201,15 +201,6 @@ fi + AX_CODE_COVERAGE + + AC_CONFIG_FILES([Makefile +- tests/Makefile +- tests/ftests/Makefile +- tests/gunit/Makefile +- tests/tools/testenv.sh +- tests/tools/Makefile +- tests/tools/cgconfigparser/Makefile +- tests/tools/cgclassify/Makefile +- tests/tools/multimount/Makefile +- tests/runlibcgrouptest.sh + src/Makefile + src/daemon/Makefile + src/tools/Makefile +-- +2.37.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..53168f8bb2fb 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" 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/${pkgname}/archive/v${version}.tar.gz" +checksum=ba6e9d1315a43771721c60bd34a7e084723b8e2ac1f4ddf8d7ba6f199b27e815 case "$XBPS_TARGET_MACHINE" in *-musl) # Add musl-fts implementation @@ -23,10 +24,6 @@ esac pre_configure() { autoreconf -if } -post_configure() { - # Disable tests - sed -i Makefile -e "/SUBDIRS =/ s; tests;;" -} libcgroup-utils_package() { short_desc+=" - utilities"