From 3143a5ffb6695f73827220c9d48ed16993da34b8 Mon Sep 17 00:00:00 2001 From: cc Date: Wed, 28 Jul 2021 17:29:47 +0200 Subject: [PATCH 1/3] libcgroup: update to 2.0. update libcgroup to version 2.0 --- .../libcgroup/patches/CVE-2018-14348.patch | 12 ------ .../patches/api.c-fix-infinite-loop.patch | 38 ------------------- srcpkgs/libcgroup/patches/musl-decls.patch | 3 +- ...-strerror_r.patch => musl-sterror_r.patch} | 4 +- srcpkgs/libcgroup/template | 14 +++---- srcpkgs/libcgroup/update | 1 - 6 files changed, 8 insertions(+), 64 deletions(-) delete mode 100644 srcpkgs/libcgroup/patches/CVE-2018-14348.patch delete mode 100644 srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch rename srcpkgs/libcgroup/patches/{musl-strerror_r.patch => musl-sterror_r.patch} (99%) delete mode 100644 srcpkgs/libcgroup/update 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 index eacf4e618d93..32a58fc7f677 100644 --- a/srcpkgs/libcgroup/patches/musl-decls.patch +++ b/srcpkgs/libcgroup/patches/musl-decls.patch @@ -3,7 +3,7 @@ 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 @@ +@@ -16,5 +16,15 @@ #ifndef _LIBCGROUP_H #define _LIBCGROUP_H @@ -18,5 +18,4 @@ include file sys/cdefs.h +#endif /* !defined(__GLIBC__) */ + #define _LIBCGROUP_H_INSIDE - #include diff --git a/srcpkgs/libcgroup/patches/musl-strerror_r.patch b/srcpkgs/libcgroup/patches/musl-sterror_r.patch similarity index 99% rename from srcpkgs/libcgroup/patches/musl-strerror_r.patch rename to srcpkgs/libcgroup/patches/musl-sterror_r.patch index 0f54e12b05d2..0f14d325e965 100644 --- a/srcpkgs/libcgroup/patches/musl-strerror_r.patch +++ b/srcpkgs/libcgroup/patches/musl-sterror_r.patch @@ -4,7 +4,7 @@ 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__) @@ -17,6 +17,6 @@ GNU libc's if _GNU_SOURCE is defined. + return "strerror_r() failed"; + } +#endif - + return cgroup_strerror_codes[code % ECGROUPNOTCOMPILED]; } diff --git a/srcpkgs/libcgroup/template b/srcpkgs/libcgroup/template index c9c19120e597..0b8b45d0bce4 100644 --- a/srcpkgs/libcgroup/template +++ b/srcpkgs/libcgroup/template @@ -1,17 +1,16 @@ # Template file for 'libcgroup' pkgname=libcgroup -version=0.41 -revision=8 +version=2.0 +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 +homepage="https://github.com/libcgroup/libcgroup" +distfiles="https://github.com/libcgroup/libcgroup/releases/download/v${version}/${pkgname}-${version}.tar.gz" +checksum=aecc501a9ea6a97da0673585db5081df912ae607dec36d5f6f7ab14f69d48ab8 case "$XBPS_TARGET_MACHINE" in *-musl) # Add musl-fts implementation @@ -20,9 +19,6 @@ case "$XBPS_TARGET_MACHINE" in ;; esac -pre_configure() { - autoreconf -if -} post_configure() { # Disable tests sed -i Makefile -e "/SUBDIRS =/ s; tests;;" diff --git a/srcpkgs/libcgroup/update b/srcpkgs/libcgroup/update deleted file mode 100644 index d395a5b230c3..000000000000 --- a/srcpkgs/libcgroup/update +++ /dev/null @@ -1 +0,0 @@ -pattern="${pkgname}-v?\K[\d.]+(?=\.tar)" From 51408c63baf33d95c8552f30431e1ec19a0440e0 Mon Sep 17 00:00:00 2001 From: na Date: Wed, 18 Aug 2021 05:31:51 +0200 Subject: [PATCH 2/3] libcgroup update version 2.o --- .../libcgroup/patches/CVE-2018-14348.patch | 12 ++++++ .../patches/api.c-fix-infinite-loop.patch | 38 +++++++++++++++++++ srcpkgs/libcgroup/patches/musl-decls.patch | 3 +- ...-sterror_r.patch => musl-strerror_r.patch} | 4 +- srcpkgs/libcgroup/template | 7 ++-- 5 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/libcgroup/patches/CVE-2018-14348.patch create mode 100644 srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch rename srcpkgs/libcgroup/patches/{musl-sterror_r.patch => musl-strerror_r.patch} (99%) diff --git a/srcpkgs/libcgroup/patches/CVE-2018-14348.patch b/srcpkgs/libcgroup/patches/CVE-2018-14348.patch new file mode 100644 index 000000000000..bd083c2aad97 --- /dev/null +++ b/srcpkgs/libcgroup/patches/CVE-2018-14348.patch @@ -0,0 +1,12 @@ +--- 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 new file mode 100644 index 000000000000..12ee0eeebc84 --- /dev/null +++ b/srcpkgs/libcgroup/patches/api.c-fix-infinite-loop.patch @@ -0,0 +1,38 @@ +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 index 32a58fc7f677..eacf4e618d93 100644 --- a/srcpkgs/libcgroup/patches/musl-decls.patch +++ b/srcpkgs/libcgroup/patches/musl-decls.patch @@ -3,7 +3,7 @@ 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,5 +16,15 @@ +@@ -16,6 +16,16 @@ #ifndef _LIBCGROUP_H #define _LIBCGROUP_H @@ -18,4 +18,5 @@ include file sys/cdefs.h +#endif /* !defined(__GLIBC__) */ + #define _LIBCGROUP_H_INSIDE + #include diff --git a/srcpkgs/libcgroup/patches/musl-sterror_r.patch b/srcpkgs/libcgroup/patches/musl-strerror_r.patch similarity index 99% rename from srcpkgs/libcgroup/patches/musl-sterror_r.patch rename to srcpkgs/libcgroup/patches/musl-strerror_r.patch index 0f14d325e965..0f54e12b05d2 100644 --- a/srcpkgs/libcgroup/patches/musl-sterror_r.patch +++ b/srcpkgs/libcgroup/patches/musl-strerror_r.patch @@ -4,7 +4,7 @@ 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__) @@ -17,6 +17,6 @@ GNU libc's if _GNU_SOURCE is defined. + return "strerror_r() failed"; + } +#endif - + return cgroup_strerror_codes[code % ECGROUPNOTCOMPILED]; } diff --git a/srcpkgs/libcgroup/template b/srcpkgs/libcgroup/template index 0b8b45d0bce4..935e9d96b222 100644 --- a/srcpkgs/libcgroup/template +++ b/srcpkgs/libcgroup/template @@ -3,15 +3,14 @@ pkgname=libcgroup version=2.0 revision=1 build_style=gnu-configure -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" +license="LGPL-2.1-only" homepage="https://github.com/libcgroup/libcgroup" -distfiles="https://github.com/libcgroup/libcgroup/releases/download/v${version}/${pkgname}-${version}.tar.gz" +distfiles="https://github.com/libcgroup/libcgroup/releases/download/v${version}/libcgroup-${version}.tar.bz2" checksum=aecc501a9ea6a97da0673585db5081df912ae607dec36d5f6f7ab14f69d48ab8 - case "$XBPS_TARGET_MACHINE" in *-musl) # Add musl-fts implementation makedepends+=" musl-fts-devel" From 2a257f4e8f5f2b42be8114c9f8d6739f9bd6b128 Mon Sep 17 00:00:00 2001 From: wibed Date: Thu, 19 Aug 2021 14:56:59 +0200 Subject: [PATCH 3/3] checksum bz2 corrected --- srcpkgs/libcgroup/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/libcgroup/template b/srcpkgs/libcgroup/template index 935e9d96b222..d490f3537ca6 100644 --- a/srcpkgs/libcgroup/template +++ b/srcpkgs/libcgroup/template @@ -10,7 +10,8 @@ maintainer="Orphaned " license="LGPL-2.1-only" homepage="https://github.com/libcgroup/libcgroup" distfiles="https://github.com/libcgroup/libcgroup/releases/download/v${version}/libcgroup-${version}.tar.bz2" -checksum=aecc501a9ea6a97da0673585db5081df912ae607dec36d5f6f7ab14f69d48ab8 +checksum=11a2fbf0e42f46089f406b8b0dca7fef04aec2f21600b70e402c5db3661305d7 + case "$XBPS_TARGET_MACHINE" in *-musl) # Add musl-fts implementation makedepends+=" musl-fts-devel"