summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/atlas-gfortran-compat.patch37
-rw-r--r--gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch22
-rw-r--r--gnu/packages/patches/binutils-libiberty-endianness-bug.patch36
-rw-r--r--gnu/packages/patches/curl-use-ssl-cert-env.patch4
-rw-r--r--gnu/packages/patches/dbus-CVE-2020-12049.patch58
-rw-r--r--gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch11
-rw-r--r--gnu/packages/patches/docbook-xsl-support-old-url.patch17
-rw-r--r--gnu/packages/patches/doxygen-1.8.17-runtests.patch73
-rw-r--r--gnu/packages/patches/doxygen-test.patch60
-rw-r--r--gnu/packages/patches/findutils-test-rwlock-threads.patch38
-rw-r--r--gnu/packages/patches/fontconfig-hurd-path-max.patch17
-rw-r--r--gnu/packages/patches/freeglut-gcc-compat.patch53
-rw-r--r--gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch21
-rw-r--r--gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch179
-rw-r--r--gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch53
-rw-r--r--gnu/packages/patches/ghostscript-CVE-2020-15900.patch36
-rw-r--r--gnu/packages/patches/ghostscript-freetype-compat.patch35
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27218.patch132
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-01.patch176
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-02.patch264
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-03.patch136
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-04.patch308
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-05.patch47
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-06.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-07.patch118
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-08.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-09.patch98
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-10.patch52
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-11.patch57
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-12.patch30
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-13.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-14.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-15.patch95
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-16.patch43
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-17.patch37
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-18.patch232
-rw-r--r--gnu/packages/patches/glib-CVE-2021-28153.patch283
-rw-r--r--gnu/packages/patches/glib-skip-failing-test.patch27
-rw-r--r--gnu/packages/patches/glib-tests-timer.patch15
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system.patch38
-rw-r--r--gnu/packages/patches/glibc-dl-cache.patch140
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch19
-rw-r--r--gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch637
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20231.patch62
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20232.patch60
-rw-r--r--gnu/packages/patches/guile-ssh-fix-test-suite.patch217
-rw-r--r--gnu/packages/patches/guile-ssh-read-error.patch18
-rw-r--r--gnu/packages/patches/icu4c-CVE-2020-10531.patch127
-rw-r--r--gnu/packages/patches/inetutils-hurd.patch583
-rw-r--r--gnu/packages/patches/jsoncpp-fix-inverted-case.patch22
-rw-r--r--gnu/packages/patches/lcms-CVE-2018-16435.patch171
-rw-r--r--gnu/packages/patches/libtirpc-hurd-client.patch50
-rw-r--r--gnu/packages/patches/libxt-guix-search-paths.patch13
-rw-r--r--gnu/packages/patches/mariadb-cmake-compat.patch17
-rw-r--r--gnu/packages/patches/meson-for-build-rpath.patch24
-rw-r--r--gnu/packages/patches/mit-krb5-hurd.patch15
-rw-r--r--gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch29
-rw-r--r--gnu/packages/patches/nss-getcwd-nonnull.patch30
-rw-r--r--gnu/packages/patches/perl-deterministic-ordering.patch29
-rw-r--r--gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch33
-rw-r--r--gnu/packages/patches/perl-no-sys-dirs.patch99
-rw-r--r--gnu/packages/patches/python-3-fix-tests.patch194
-rw-r--r--gnu/packages/patches/python-3-hurd-configure.patch27
-rw-r--r--gnu/packages/patches/python-3.8-CVE-2021-3177.patch194
-rw-r--r--gnu/packages/patches/python-3.8-fix-tests.patch42
-rw-r--r--gnu/packages/patches/python-3.9-fix-tests.patch370
-rw-r--r--gnu/packages/patches/python-babel-fix-parse-future-test.patch68
-rw-r--r--gnu/packages/patches/python-libxml2-python39-compat.patch94
-rw-r--r--gnu/packages/patches/python-typing-inspect-fix.patch38
-rw-r--r--gnu/packages/patches/rust-1.19-mrustc.patch28
-rw-r--r--gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch111
-rw-r--r--gnu/packages/patches/rust-1.30-gdb-llvm.patch89
-rw-r--r--gnu/packages/patches/rust-1.45-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-1.48-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-bootstrap-stage0-test.patch55
-rw-r--r--gnu/packages/patches/tcl-fix-cross-compilation.patch39
-rw-r--r--gnu/packages/patches/tcsh-fix-autotest.patch11
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.83.patch52
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.86.patch17
-rw-r--r--gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch68
-rw-r--r--gnu/packages/patches/zziplib-CVE-2018-16548.patch49
81 files changed, 1262 insertions, 5897 deletions
diff --git a/gnu/packages/patches/atlas-gfortran-compat.patch b/gnu/packages/patches/atlas-gfortran-compat.patch
new file mode 100644
index 0000000000..5b46f5a64d
--- /dev/null
+++ b/gnu/packages/patches/atlas-gfortran-compat.patch
@@ -0,0 +1,37 @@
+Fix build with gfortran 10.
+
+Taken from Debian:
+https://salsa.debian.org/science-team/atlas/-/blob/master/debian/patches/gfortran-10.patch
+
+--- a/interfaces/blas/C/testing/c_dblat1.f
++++ b/interfaces/blas/C/testing/c_dblat1.f
+@@ -247,11 +247,11 @@
+ IF (ICASE.EQ.7) THEN
+ * .. DNRM2TEST ..
+ STEMP(1) = DTRUE1(NP1)
+- CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++ CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+ ELSE IF (ICASE.EQ.8) THEN
+ * .. DASUMTEST ..
+ STEMP(1) = DTRUE3(NP1)
+- CALL STEST1(DASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++ CALL STEST1(DASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+ ELSE IF (ICASE.EQ.9) THEN
+ * .. DSCALTEST ..
+ CALL DSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
+--- a/interfaces/blas/C/testing/c_sblat1.f
++++ b/interfaces/blas/C/testing/c_sblat1.f
+@@ -247,11 +247,11 @@
+ IF (ICASE.EQ.7) THEN
+ * .. SNRM2TEST ..
+ STEMP(1) = DTRUE1(NP1)
+- CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++ CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+ ELSE IF (ICASE.EQ.8) THEN
+ * .. SASUMTEST ..
+ STEMP(1) = DTRUE3(NP1)
+- CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++ CALL STEST1(SASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+ ELSE IF (ICASE.EQ.9) THEN
+ * .. SSCALTEST ..
+ CALL SSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
diff --git a/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
new file mode 100644
index 0000000000..56d404da15
--- /dev/null
+++ b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
@@ -0,0 +1,22 @@
+Patch borrowed from Arch Linux. Allows compiling bdb 5.3 and earlier with GCC newer than 7.
+
+--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
++++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
+@@ -144,7 +144,7 @@
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __atomic_compare_exchange_db((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_db(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
diff --git a/gnu/packages/patches/binutils-libiberty-endianness-bug.patch b/gnu/packages/patches/binutils-libiberty-endianness-bug.patch
new file mode 100644
index 0000000000..e6c82f704e
--- /dev/null
+++ b/gnu/packages/patches/binutils-libiberty-endianness-bug.patch
@@ -0,0 +1,36 @@
+This patch fixes a bug exposed when running the libiberty test suite on
+big-endian machines.
+
+Original bug report:
+https://sourceware.org/bugzilla/show_bug.cgi?id=27751
+Follow-ups:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100177
+https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568314.html
+
+---
+ libiberty/rust-demangle.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index 6fd8f6a4db0..848563fa3c3 100644
+--- a/libiberty/rust-demangle.c
++++ b/libiberty/rust-demangle.c
+@@ -1253,9 +1253,12 @@ demangle_const_char (struct rust_demangler *rdm)
+ else if (value == '\n')
+ PRINT ("\\n");
+ else if (value > ' ' && value < '~')
+- /* Rust also considers many non-ASCII codepoints to be printable, but
+- that logic is not easily ported to C. */
+- print_str (rdm, (char *) &value, 1);
++ {
++ /* Rust also considers many non-ASCII codepoints to be printable, but
++ that logic is not easily ported to C. */
++ char c = value;
++ print_str (rdm, &c, 1);
++ }
+ else
+ {
+ PRINT ("\\u{");
+--
+2.31.1
+
diff --git a/gnu/packages/patches/curl-use-ssl-cert-env.patch b/gnu/packages/patches/curl-use-ssl-cert-env.patch
index c8e80b4445..24be6e31d9 100644
--- a/gnu/packages/patches/curl-use-ssl-cert-env.patch
+++ b/gnu/packages/patches/curl-use-ssl-cert-env.patch
@@ -47,14 +47,14 @@ diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
+ extern char * Curl_ssl_cert_dir;
+ extern char * Curl_ssl_cert_file;
+ if(Curl_ssl_cert_dir) {
-+ if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_ORIG], Curl_ssl_cert_dir))
++ if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
+ return result;
+ if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
+ return result;
+ }
+
+ if(Curl_ssl_cert_file) {
-+ if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], Curl_ssl_cert_file))
++ if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
+ return result;
+ if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
+ return result;
diff --git a/gnu/packages/patches/dbus-CVE-2020-12049.patch b/gnu/packages/patches/dbus-CVE-2020-12049.patch
deleted file mode 100644
index 71280144a1..0000000000
--- a/gnu/packages/patches/dbus-CVE-2020-12049.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Fix CVE-2020-12049:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12049
-https://lists.freedesktop.org/archives/ftp-release/2020-June/000753.html
-
-Taken from upstream:
-
-https://gitlab.freedesktop.org/dbus/dbus/-/commit/272d484283883fa9ff95b69d924fff6cd34842f5
-
-diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
---- a/dbus/dbus-sysdeps-unix.c
-+++ b/dbus/dbus-sysdeps-unix.c
-@@ -435,18 +435,6 @@ _dbus_read_socket_with_unix_fds (DBusSocket fd,
- struct cmsghdr *cm;
- dbus_bool_t found = FALSE;
-
-- if (m.msg_flags & MSG_CTRUNC)
-- {
-- /* Hmm, apparently the control data was truncated. The bad
-- thing is that we might have completely lost a couple of fds
-- without chance to recover them. Hence let's treat this as a
-- serious error. */
--
-- errno = ENOSPC;
-- _dbus_string_set_length (buffer, start);
-- return -1;
-- }
--
- for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
- if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
- {
-@@ -501,6 +489,26 @@ _dbus_read_socket_with_unix_fds (DBusSocket fd,
- if (!found)
- *n_fds = 0;
-
-+ if (m.msg_flags & MSG_CTRUNC)
-+ {
-+ unsigned int i;
-+
-+ /* Hmm, apparently the control data was truncated. The bad
-+ thing is that we might have completely lost a couple of fds
-+ without chance to recover them. Hence let's treat this as a
-+ serious error. */
-+
-+ /* We still need to close whatever fds we *did* receive,
-+ * otherwise they'll never get closed. (CVE-2020-12049) */
-+ for (i = 0; i < *n_fds; i++)
-+ close (fds[i]);
-+
-+ *n_fds = 0;
-+ errno = ENOSPC;
-+ _dbus_string_set_length (buffer, start);
-+ return -1;
-+ }
-+
- /* put length back (doesn't actually realloc) */
- _dbus_string_set_length (buffer, start + bytes_read);
-
diff --git a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
index 4199dd18a5..fed4b76429 100644
--- a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
+++ b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
@@ -5,7 +5,7 @@ https://bugzilla.samba.org/show_bug.cgi?id=9515
https://bugzilla.gnome.org/show_bug.cgi?id=736077 (for xsltproc)
Patch copied from Debian:
-https://anonscm.debian.org/cgit/collab-maint/docbook-xsl.git/tree/debian/patches/765567_non-recursive_string_subst.patch
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/765567_non-recursive_string_subst.patch
Description: use EXSLT "replace" function when available
A recursive implementation of string.subst is problematic,
@@ -15,11 +15,12 @@ Bug-Debian: https://bugs.debian.org/750593
--- a/lib/lib.xsl
+++ b/lib/lib.xsl
-@@ -10,7 +10,10 @@
+@@ -6,7 +6,11 @@
+
This module implements DTD-independent functions
- ******************************************************************** -->
--<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+- ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++ ******************************************************************** -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="str"
@@ -27,7 +28,7 @@ Bug-Debian: https://bugs.debian.org/750593
<xsl:template name="dot.count">
<!-- Returns the number of "." characters in a string -->
-@@ -56,6 +59,9 @@
+@@ -52,6 +56,9 @@
<xsl:param name="replacement"/>
<xsl:choose>
diff --git a/gnu/packages/patches/docbook-xsl-support-old-url.patch b/gnu/packages/patches/docbook-xsl-support-old-url.patch
new file mode 100644
index 0000000000..5b7dda458f
--- /dev/null
+++ b/gnu/packages/patches/docbook-xsl-support-old-url.patch
@@ -0,0 +1,17 @@
+Docbook 1.79.2 makes very few changes apart from changing the canonical URL
+to cdn.docbook.org. This patch adds support for the previous URL to avoid
+breaking packages that still use that.
+
+Adapted from Debian:
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/0005-catalog.xml-Compatibility-with-1.79.1-or-earlier.patch
+
+--- a/catalog.xml
++++ b/catalog.xml
+@@ -5,4 +5,7 @@
+ <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/current/" rewritePrefix="./"/>
+ <rewriteURI uriStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
+ <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
++ <!-- Also support old URI of v1.79.1 or earlier -->
++ <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
++ <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
+ </catalog>
diff --git a/gnu/packages/patches/doxygen-1.8.17-runtests.patch b/gnu/packages/patches/doxygen-1.8.17-runtests.patch
deleted file mode 100644
index 0340c72448..0000000000
--- a/gnu/packages/patches/doxygen-1.8.17-runtests.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-1.8.17 was released with a broken test runner.
-
-https://github.com/doxygen/doxygen/issues/7464
-
-Taken from upstream:
-https://github.com/doxygen/doxygen/commit/cd9dee013dc749a10bbe019c350e0e62b6635795
-
-diff --git a/testing/runtests.py b/testing/runtests.py
-index a4118b865..10fe50214 100755
---- a/testing/runtests.py
-+++ b/testing/runtests.py
-@@ -3,6 +3,7 @@
- from __future__ import print_function
- import argparse, glob, itertools, re, shutil, os, sys
- import subprocess
-+import shlex
-
- config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
-
-@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
- return os.popen(cmd).read() # Python 2 without encoding
- else:
- if (getStderr):
-- proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
-- return proc.stderr
-+ proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+ return proc.stderr.read()
- else:
-- proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+ proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
- return proc.stdout.read()
-
- class Tester:
-@@ -137,7 +138,7 @@ def prepare_test(self):
- print('GENERATE_DOCBOOK=NO', file=f)
- if (self.args.xhtml):
- print('GENERATE_HTML=YES', file=f)
-- # HTML_OUTPUT can also be set locally
-+ # HTML_OUTPUT can also have been set locally
- print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
- print('HTML_FILE_EXTENSION=.xhtml', file=f)
- if (self.args.pdf):
-@@ -184,7 +185,7 @@ def update_test(self,testmgr):
- print('Non-existing file %s after \'check:\' statement' % check_file)
- return
- # convert output to canonical form
-- data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
-+ data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
- if data:
- # strip version
- data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
-@@ -326,7 +327,7 @@ def perform_test(self,testmgr):
- tests.append(glob.glob('%s/*.xml' % (docbook_output)))
- tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
- tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
-- exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
-+ exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
- exe_string1 = exe_string
- exe_string += ' %s' % (redirx)
- exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
-@@ -346,7 +347,11 @@ def perform_test(self,testmgr):
- redirx=' 2> %s/temp >nul:'%html_output
- else:
- redirx='2>%s/temp >/dev/null'%html_output
-- exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
-+ check_file = []
-+ check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
-+ check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
-+ check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
-+ exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
- exe_string1 = exe_string
- exe_string += ' %s' % (redirx)
- exe_string += ' %s more "%s/temp"' % (separ,html_output)
diff --git a/gnu/packages/patches/doxygen-test.patch b/gnu/packages/patches/doxygen-test.patch
deleted file mode 100644
index 1c0d4eb946..0000000000
--- a/gnu/packages/patches/doxygen-test.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Modify the expected outcome of test 012 so that it passes when bibtex is
-not in the path, as we do not wish to add texlive as an input just for this
-test.
-
-diff -u -r doxygen-1.8.7.orig/testing/012/citelist.xml doxygen-1.8.7/testing/012/citelist.xml
---- doxygen-1.8.7.orig/testing/012/citelist.xml 2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/citelist.xml 2014-04-24 23:49:43.000000000 +0200
-@@ -6,38 +6,6 @@
- <briefdescription>
- </briefdescription>
- <detaileddescription>
-- <para>
-- <variablelist>
-- <varlistentry>
-- <term><anchor id="citelist_1CITEREF_Be09"/>[1]</term>
-- </varlistentry>
-- <listitem>
-- <para>P.<nonbreakablespace/>Belotti. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 117<ndash/>144.</para>
-- <para/>
-- </listitem>
-- <varlistentry>
-- <term><anchor id="citelist_1CITEREF_BertholdHeinzVigerske2009"/>[2]</term>
-- </varlistentry>
-- <listitem>
-- <para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 427<ndash/>444.</para>
-- <para/>
-- </listitem>
-- <varlistentry>
-- <term><anchor id="citelist_1CITEREF_knuth79"/>[3]</term>
-- </varlistentry>
-- <listitem>
-- <para>Donald<nonbreakablespace/>E. Knuth. <emphasis>Tex and Metafont, New Directions in Typesetting</emphasis>. American Mathematical Society and Digital Press, Stanford, 1979.</para>
-- <para/>
-- </listitem>
-- <varlistentry>
-- <term><anchor id="citelist_1CITEREF_LeLe12"/>[4]</term>
-- </varlistentry>
-- <listitem>
-- <para>Jon Lee and Sven Leyffer, editors. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3"><emphasis>Mixed Integer Nonlinear Programming</emphasis></ulink>, volume 154 of <emphasis>The IMA Volumes in Mathematics and its Applications</emphasis>. Springer, 2012.</para>
-- <para/>
-- </listitem>
-- </variablelist>
-- </para>
- </detaileddescription>
- </compounddef>
- </doxygen>
-diff -u -r doxygen-1.8.7.orig/testing/012/indexpage.xml doxygen-1.8.7/testing/012/indexpage.xml
---- doxygen-1.8.7.orig/testing/012/indexpage.xml 2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/indexpage.xml 2014-04-24 23:44:05.000000000 +0200
-@@ -6,8 +6,8 @@
- <briefdescription>
- </briefdescription>
- <detaileddescription>
-- <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
-- <para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
-+ <para>See knuth79 for more info.</para>
-+ <para>Other references with cross references see Be09 and BertholdHeinzVigerske2009 for more info. </para>
- </detaileddescription>
- </compounddef>
- </doxygen>
diff --git a/gnu/packages/patches/findutils-test-rwlock-threads.patch b/gnu/packages/patches/findutils-test-rwlock-threads.patch
deleted file mode 100644
index 3062577c21..0000000000
--- a/gnu/packages/patches/findutils-test-rwlock-threads.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Skip "test-rwlock1" when multithreading is disabled, which is the case
-during bootstrapping on architectures not supported by GNU Mes.
-
-Taken from upstream gnulib:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=fdff8bd09a7f053381f8bdb107ab5280b7c95959
-
-diff --git a/gnulib-tests/test-rwlock1.c b/gnulib-tests/test-rwlock1.c
---- a/gnulib-tests/test-rwlock1.c
-+++ b/gnulib-tests/test-rwlock1.c
-@@ -21,6 +21,8 @@
-
- #include <config.h>
-
-+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
-+
- #include "glthread/lock.h"
-
- #include <errno.h>
-@@ -151,3 +153,18 @@ main ()
- sleep (1);
- }
- }
-+
-+#else
-+
-+/* No multithreading available. */
-+
-+#include <stdio.h>
-+
-+int
-+main ()
-+{
-+ fputs ("Skipping test: multithreading not enabled\n", stderr);
-+ return 77;
-+}
-+
-+#endif
-
diff --git a/gnu/packages/patches/fontconfig-hurd-path-max.patch b/gnu/packages/patches/fontconfig-hurd-path-max.patch
deleted file mode 100644
index f804e6801f..0000000000
--- a/gnu/packages/patches/fontconfig-hurd-path-max.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Avoid usage of PATH_MAX.
-
-Taken from https://salsa.debian.org/freedesktop-team/fontconfig/-/blob/master/debian/patches/path_max.patch
-
-Index: fontconfig-2.13.1/src/fccfg.c
-===================================================================
---- fontconfig-2.13.1.orig/src/fccfg.c
-+++ fontconfig-2.13.1/src/fccfg.c
-@@ -2231,7 +2231,7 @@ FcConfigRealFilename (FcConfig *config,
-
- if (n)
- {
-- FcChar8 buf[PATH_MAX];
-+ FcChar8 buf[FC_PATH_MAX];
- ssize_t len;
-
- if (sysroot)
diff --git a/gnu/packages/patches/freeglut-gcc-compat.patch b/gnu/packages/patches/freeglut-gcc-compat.patch
new file mode 100644
index 0000000000..126bbd89f4
--- /dev/null
+++ b/gnu/packages/patches/freeglut-gcc-compat.patch
@@ -0,0 +1,53 @@
+Fix build failure with GCC 10.
+
+Taken from upstream:
+https://github.com/dcnieho/FreeGLUT/commit/b9998bbc1e1c329f6bf69c24606a2be7a4973b8c
+
+diff --git a/src/fg_gl2.c b/src/fg_gl2.c
+--- a/src/fg_gl2.c
++++ b/src/fg_gl2.c
+@@ -27,6 +27,20 @@
+ #include "fg_internal.h"
+ #include "fg_gl2.h"
+
++#ifndef GL_ES_VERSION_2_0
++/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
++ * names are defined in fg_gl2.h header to reference them, for any other case,
++ * define them as function pointers here.
++ */
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++FGH_PFNGLBUFFERDATAPROC fghBufferData;
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++#endif
++
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
+ if (fgStructure.CurrentWindow != NULL)
+ fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+diff --git a/src/fg_gl2.h b/src/fg_gl2.h
+--- a/src/fg_gl2.h
++++ b/src/fg_gl2.h
+@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+-FGH_PFNGLBUFFERDATAPROC fghBufferData;
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+
+ # endif
+
diff --git a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch b/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
deleted file mode 100644
index 1358e30633..0000000000
--- a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Do not override PYTHONPATH when calling Python code from the Haskell
-daemons. This is necessary because the Python library dependencies are
-only available through PYTHONPATH.
-
-diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs
---- a/src/Ganeti/Query/Exec.hs
-+++ b/src/Ganeti/Query/Exec.hs
-@@ -99,12 +99,10 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $
- do
- use_debug <- isDebugMode
- env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0")
-- . M.insert "PYTHONPATH" AC.pythondir
- . M.fromList)
- `liftM` getEnvironment
- execPy <- P.jqueueExecutorPy
- logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy
-- ++ " with PYTHONPATH=" ++ AC.pythondir
-
- (master, child) <- pipeClient connectConfig
- let (rh, wh) = clientToHandle child
-
diff --git a/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch
new file mode 100644
index 0000000000..6329b129d3
--- /dev/null
+++ b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch
@@ -0,0 +1,179 @@
+From 9b31dfda73ee2d1b56b3f0dcfd3246c2faa592fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@zaclys.net>
+Date: Sun, 28 Mar 2021 19:47:25 +0200
+Subject: [PATCH] Revert "fix #303: gdlib.pc: use Requires instead of Libs
+ (#537)"
+
+This reverts commit 28ecfe77c817aff8ce56422d3e4e8533a281bc76.
+---
+ CMakeLists.txt | 12 ------------
+ config/gdlib.pc.cmake | 4 +---
+ config/gdlib.pc.in | 4 +---
+ configure.ac | 11 +----------
+ src/CMakeLists.txt | 6 ------
+ 5 files changed, 3 insertions(+), 34 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 57cd95d..6bd0c73 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,8 +53,6 @@ SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+ "Single Directory for all static libraries."
+ )
+
+-SET(PKG_REQUIRES_PRIVATES "")
+-
+ if (USE_EXT_GD)
+ message("Using GD at: ${USE_EXT_GD}")
+ INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
+@@ -170,13 +168,11 @@ else (USE_EXT_GD)
+ INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
+ SET(HAVE_FT2BUILD_H 1)
+ SET(HAVE_LIBFREETYPE 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES freetype2)
+ ENDIF(FREETYPE_FOUND)
+
+ IF(ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ SET(HAVE_LIBZ 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES zlib)
+ ENDIF(ZLIB_FOUND)
+
+ IF(WEBP_FOUND)
+@@ -192,7 +188,6 @@ else (USE_EXT_GD)
+ IF(PNG_FOUND)
+ INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
+ SET(HAVE_LIBPNG 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES libpng)
+ ENDIF(PNG_FOUND)
+
+ IF(ICONV_FOUND)
+@@ -209,25 +204,21 @@ else (USE_EXT_GD)
+ IF(XPM_FOUND)
+ INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR})
+ SET(HAVE_LIBXPM 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES xpm)
+ ENDIF(XPM_FOUND)
+
+ IF(JPEG_FOUND)
+ INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
+ SET(HAVE_LIBJPEG 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg)
+ ENDIF(JPEG_FOUND)
+
+ IF(TIFF_FOUND)
+ INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
+ SET(HAVE_LIBTIFF 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES libtiff-4)
+ ENDIF(TIFF_FOUND)
+
+ IF(FONTCONFIG_FOUND)
+ INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
+ SET(HAVE_LIBFONTCONFIG 1)
+- LIST(APPEND PKG_REQUIRES_PRIVATES fontconfig)
+ ELSE (FONTCONFIG_FOUND)
+ SET(FONTCONFIG_LIBRARY "")
+ SET(FONTCONFIG_INCLUDE_DIR "")
+@@ -236,11 +227,8 @@ else (USE_EXT_GD)
+
+ IF(RAQM_FOUND)
+ INCLUDE_DIRECTORIES(${RAQM_INCLUDE_DIR})
+- SET(HAVE_RAQM 1)
+- LIST(APPEND PKG_REQUIRES_PRIVAES raqm)
+ ENDIF(RAQM_FOUND)
+
+- string(REPLACE ";" ", " PKG_REQUIRES_PRIVATES "${PKG_REQUIRES_PRIVATES}")
+ SET(HAVE_CONFIG_H 1)
+
+ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+diff --git a/config/gdlib.pc.cmake b/config/gdlib.pc.cmake
+index 5fc8af4..d1a0dda 100644
+--- a/config/gdlib.pc.cmake
++++ b/config/gdlib.pc.cmake
+@@ -6,8 +6,6 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+ Name: gd
+ Description: GD graphics library
+ Version: @GDLIB_VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@
++Libs.private: @LIBGD_DEP_LIBS@
+ Libs: -L${libdir} -lgd
+diff --git a/config/gdlib.pc.in b/config/gdlib.pc.in
+index d6bc375..b980a60 100644
+--- a/config/gdlib.pc.in
++++ b/config/gdlib.pc.in
+@@ -6,8 +6,6 @@ includedir=@includedir@
+ Name: gd
+ Description: GD graphics library
+ Version: @VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@ @LIBICONV@
++Libs.private: @LIBS@ @LIBICONV@
+ Libs: -L${libdir} -lgd
+diff --git a/configure.ac b/configure.ac
+index 535db68..329c99c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,9 +33,6 @@ AC_SUBST(GDLIB_LT_CURRENT)
+ AC_SUBST(GDLIB_LT_REVISION)
+ AC_SUBST(GDLIB_LT_AGE)
+
+-AC_SUBST(LIBS_PRIVATES)
+-AC_SUBST(PKG_REQUIRES_PRIVATES)
+-
+ AM_INIT_AUTOMAKE([1.11 foreign dist-xz -Wall -Werror subdir-objects])
+ AC_CONFIG_HEADERS([src/config.h:src/config.hin])
+
+@@ -133,7 +130,6 @@ m4_define([GD_LIB_CHECK], [dnl
+ AC_MSG_RESULT([$gd_with_lib])
+
+ gd_found_lib=no
+- gd_require_pkg_name=""
+ if test "$gd_with_lib" != "no"; then
+ save_CPPFLAGS=$CPPFLAGS
+ save_LDFLAGS=$LDFLAGS
+@@ -165,11 +161,6 @@ m4_define([GD_LIB_CHECK], [dnl
+ $1][_CFLAGS="$gd_lib_cflags $][$1][_CFLAGS"
+ AS_VAR_APPEND([LIBS], [" $][$1][_LIBS"])
+ AS_VAR_APPEND([CPPFLAGS], [" $][$1][_CFLAGS"])
+- if test -z "$gd_require_pkg_name"; then
+- AS_VAR_APPEND([LIBS_PRIVATES], [" $][$1][_LIBS"])
+- else
+- AS_VAR_APPEND([PKG_REQUIRES_PRIVATES], [" $gd_require_pkg_name"])
+- fi
+ elif test "$gd_with_lib" = "yes"; then
+ AC_MSG_ERROR([$3 requested but not found])
+ else
+@@ -189,7 +180,7 @@ dnl $4 - pkg-config module to look for
+ dnl $5 - fallback test for the feature
+ m4_define([GD_LIB_PKG_CHECK], [dnl
+ GD_LIB_CHECK([$1], [$2], [$3], [dnl
+- PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes gd_require_pkg_name="$4"], [$5])
++ PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes], [$5])
+ ])
+ ])
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 509c422..49adbd6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -142,12 +142,6 @@ if (BUILD_STATIC_LIBS)
+ target_link_libraries(${GD_LIB_STATIC} ${LIBGD_DEP_LIBS})
+ endif()
+
+-SET(LIBS_PRIVATES
+- ${ICONV_LIBRARIES}
+- ${LIQ_LIBRARIES}
+- ${WEBP_LIBRARIES}
+-)
+-
+ set(GD_PROGRAMS gdcmpgif)
+
+ if (PNG_FOUND)
+--
+2.31.1
+
diff --git a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch b/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
deleted file mode 100644
index e6ac4de00b..0000000000
--- a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Fix CVE-2020-29385. Note that we omit the binary test file
-tests/test-images/fail/hang_114.gif from the following commit, to avoid
-requiring 'git' to apply the patch.
-
-
-From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001
-From: Robert Ancell <robert.ancell@canonical.com>
-Date: Mon, 30 Nov 2020 12:26:12 +1300
-Subject: [PATCH] gif: Fix LZW decoder accepting invalid LZW code.
-
-The code value after a reset wasn't being validated, which means we would
-accept invalid codes. This could cause an infinite loop in the decoder.
-
-Fixes CVE-2020-29385
-
-Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
----
- gdk-pixbuf/lzw.c | 13 +++++++------
- tests/test-images/fail/hang_114.gif | Bin 0 -> 5561 bytes
- 2 files changed, 7 insertions(+), 6 deletions(-)
- create mode 100644 tests/test-images/fail/hang_114.gif
-
-diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
-index 9e052a6f7..105daf2b1 100644
---- a/gdk-pixbuf/lzw.c
-+++ b/gdk-pixbuf/lzw.c
-@@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self,
- if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) {
- if (self->code < self->code_table_size)
- add_code (self, self->code);
-- else if (self->code == self->code_table_size)
-+ else
- add_code (self, self->last_code);
-- else {
-- /* Invalid code received - just stop here */
-- self->last_code = self->eoi_code;
-- return output_length;
-- }
-
- /* When table is full increase code size */
- if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX)
- self->code_size++;
- }
-
-+ /* Invalid code received - just stop here */
-+ if (self->code >= self->code_table_size) {
-+ self->last_code = self->eoi_code;
-+ return output_length;
-+ }
-+
- /* Convert codeword into indexes */
- n_written += write_indexes (self, output + n_written, output_length - n_written);
- }
diff --git a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
deleted file mode 100644
index b6658d7c7f..0000000000
--- a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix CVE-2020-15900.
-
-https://cve.circl.lu/cve/CVE-2020-15900
-https://artifex.com/security-advisories/CVE-2020-15900
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b
-
-diff --git a/psi/zstring.c b/psi/zstring.c
---- a/psi/zstring.c
-+++ b/psi/zstring.c
-@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward)
- return 0;
- found:
- op->tas.type_attrs = op1->tas.type_attrs;
-- op->value.bytes = ptr;
-- r_set_size(op, size);
-+ op->value.bytes = ptr; /* match */
-+ op->tas.rsize = size; /* match */
- push(2);
-- op[-1] = *op1;
-- r_set_size(op - 1, ptr - op[-1].value.bytes);
-- op1->value.bytes = ptr + size;
-- r_set_size(op1, count + (!forward ? (size - 1) : 0));
-+ op[-1] = *op1; /* pre */
-+ op[-3].value.bytes = ptr + size; /* post */
-+ if (forward) {
-+ op[-1].tas.rsize = ptr - op[-1].value.bytes; /* pre */
-+ op[-3].tas.rsize = count; /* post */
-+ } else {
-+ op[-1].tas.rsize = count; /* pre */
-+ op[-3].tas.rsize -= count + size; /* post */
-+ }
- make_true(op);
- return 0;
- }
diff --git a/gnu/packages/patches/ghostscript-freetype-compat.patch b/gnu/packages/patches/ghostscript-freetype-compat.patch
deleted file mode 100644
index cc225b5ad6..0000000000
--- a/gnu/packages/patches/ghostscript-freetype-compat.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Fix build with FreeType 2.10.3 and newer.
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=41ef9a0bc36b9db7115fbe9623f989bfb47bbade
-
-diff --git a/base/fapi_ft.c b/base/fapi_ft.c
---- a/base/fapi_ft.c
-+++ b/base/fapi_ft.c
-@@ -125,7 +125,7 @@ static void
- delete_inc_int_info(gs_fapi_server * a_server,
- FT_IncrementalRec * a_inc_int_info);
-
--FT_CALLBACK_DEF(void *)
-+static void *
- FF_alloc(FT_Memory memory, long size)
- {
- gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
- return (gs_malloc(mem, size, 1, "FF_alloc"));
- }
-
--FT_CALLBACK_DEF(void *)
-+static void *
- FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
- {
- gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
- return (tmp);
- }
-
--FT_CALLBACK_DEF(void)
-+static void
- FF_free(FT_Memory memory, void *block)
- {
- gs_memory_t *mem = (gs_memory_t *) memory->user;
diff --git a/gnu/packages/patches/glib-CVE-2021-27218.patch b/gnu/packages/patches/glib-CVE-2021-27218.patch
deleted file mode 100644
index 00fa5ebf79..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27218.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-Backport of:
-
-From 0f384c88a241bbbd884487b1c40b7b75f1e638d3 Mon Sep 17 00:00:00 2001
-From: Krzesimir Nowak <qdlacz@gmail.com>
-Date: Wed, 10 Feb 2021 23:51:07 +0100
-Subject: [PATCH] gbytearray: Do not accept too large byte arrays
-
-GByteArray uses guint for storing the length of the byte array, but it
-also has a constructor (g_byte_array_new_take) that takes length as a
-gsize. gsize may be larger than guint (64 bits for gsize vs 32 bits
-for guint). It is possible to call the function with a value greater
-than G_MAXUINT, which will result in silent length truncation. This
-may happen as a result of unreffing GBytes into GByteArray, so rather
-be loud about it.
-
-(Test case tweaked by Philip Withnall.)
-
-(Backport 2.66: Add #include gstrfuncsprivate.h in the test case for
-`g_memdup2()`.)
----
- glib/garray.c | 6 ++++++
- glib/gbytes.c | 4 ++++
- glib/tests/bytes.c | 35 ++++++++++++++++++++++++++++++++++-
- 3 files changed, 44 insertions(+), 1 deletion(-)
-
-diff --git a/glib/garray.c b/glib/garray.c
-index 942e74c9f..fb1a42aaf 100644
---- a/glib/garray.c
-+++ b/glib/garray.c
-@@ -2013,6 +2013,10 @@ g_byte_array_new (void)
- * Create byte array containing the data. The data will be owned by the array
- * and will be freed with g_free(), i.e. it could be allocated using g_strdup().
- *
-+ * Do not use it if @len is greater than %G_MAXUINT. #GByteArray
-+ * stores the length of its data in #guint, which may be shorter than
-+ * #gsize.
-+ *
- * Since: 2.32
- *
- * Returns: (transfer full): a new #GByteArray
-@@ -2024,6 +2028,8 @@ g_byte_array_new_take (guint8 *data,
- GByteArray *array;
- GRealArray *real;
-
-+ g_return_val_if_fail (len <= G_MAXUINT, NULL);
-+
- array = g_byte_array_new ();
- real = (GRealArray *)array;
- g_assert (real->data == NULL);
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index 7b72886e5..d56abe6c3 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -519,6 +519,10 @@ g_bytes_unref_to_data (GBytes *bytes,
- * g_bytes_new(), g_bytes_new_take() or g_byte_array_free_to_bytes(). In all
- * other cases the data is copied.
- *
-+ * Do not use it if @bytes contains more than %G_MAXUINT
-+ * bytes. #GByteArray stores the length of its data in #guint, which
-+ * may be shorter than #gsize, that @bytes is using.
-+ *
- * Returns: (transfer full): a new mutable #GByteArray containing the same byte data
- *
- * Since: 2.32
-diff --git a/glib/tests/bytes.c b/glib/tests/bytes.c
-index 5ea5c2b35..15a6aaad6 100644
---- a/glib/tests/bytes.c
-+++ b/glib/tests/bytes.c
-@@ -10,12 +10,12 @@
- */
-
- #undef G_DISABLE_ASSERT
--#undef G_LOG_DOMAIN
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "glib.h"
-+#include "glib/gstrfuncsprivate.h"
-
- /* Keep in sync with glib/gbytes.c */
- struct _GBytes
-@@ -333,6 +333,38 @@ test_to_array_transferred (void)
- g_byte_array_unref (array);
- }
-
-+static void
-+test_to_array_transferred_oversize (void)
-+{
-+ g_test_message ("g_bytes_unref_to_array() can only take GBytes up to "
-+ "G_MAXUINT in length; test that longer ones are rejected");
-+
-+ if (sizeof (guint) >= sizeof (gsize))
-+ {
-+ g_test_skip ("Skipping test as guint is not smaller than gsize");
-+ }
-+ else if (g_test_undefined ())
-+ {
-+ GByteArray *array = NULL;
-+ GBytes *bytes = NULL;
-+ gpointer data = g_memdup2 (NYAN, N_NYAN);
-+ gsize len = ((gsize) G_MAXUINT) + 1;
-+
-+ bytes = g_bytes_new_take (data, len);
-+ g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
-+ "g_byte_array_new_take: assertion 'len <= G_MAXUINT' failed");
-+ array = g_bytes_unref_to_array (g_steal_pointer (&bytes));
-+ g_test_assert_expected_messages ();
-+ g_assert_null (array);
-+
-+ g_free (data);
-+ }
-+ else
-+ {
-+ g_test_skip ("Skipping test as testing undefined behaviour is disabled");
-+ }
-+}
-+
- static void
- test_to_array_two_refs (void)
- {
-@@ -410,6 +442,7 @@ main (int argc, char *argv[])
- g_test_add_func ("/bytes/to-array/transfered", test_to_array_transferred);
- g_test_add_func ("/bytes/to-array/two-refs", test_to_array_two_refs);
- g_test_add_func ("/bytes/to-array/non-malloc", test_to_array_non_malloc);
-+ g_test_add_func ("/bytes/to-array/transferred/oversize", test_to_array_transferred_oversize);
- g_test_add_func ("/bytes/null", test_null);
-
- return g_test_run ();
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-01.patch b/gnu/packages/patches/glib-CVE-2021-27219-01.patch
deleted file mode 100644
index 5db360d468..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-01.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-Backport of:
-
-From 5e5f75a77e399c638be66d74e5daa8caeb433e00 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:30:52 +0000
-Subject: [PATCH 01/11] gstrfuncs: Add internal g_memdup2() function
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This will replace the existing `g_memdup()` function for use within
-GLib. It has an unavoidable security flaw of taking its `byte_size`
-argument as a `guint` rather than as a `gsize`. Most callers will
-expect it to be a `gsize`, and may pass in large values which could
-silently be truncated, resulting in an undersize allocation compared
-to what the caller expects.
-
-This could lead to a classic buffer overflow vulnerability for many
-callers of `g_memdup()`.
-
-`g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`.
-
-Spotted by Kevin Backhouse of GHSL.
-
-In GLib 2.68, `g_memdup2()` will be a new public API. In this version
-for backport to older stable releases, it’s a new `static inline` API
-in a private header, so that use of `g_memdup()` within GLib can be
-fixed without adding a new API in a stable release series.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: GHSL-2021-045
-Helps: #2319
----
- docs/reference/glib/meson.build | 1 +
- glib/gstrfuncsprivate.h | 55 +++++++++++++++++++++++++++++++++
- glib/meson.build | 1 +
- glib/tests/strfuncs.c | 23 ++++++++++++++
- 4 files changed, 80 insertions(+)
- create mode 100644 glib/gstrfuncsprivate.h
-
-diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build
-index bba7649f0..ee39f6d04 100644
---- a/docs/reference/glib/meson.build
-+++ b/docs/reference/glib/meson.build
-@@ -22,6 +22,7 @@ if get_option('gtk_doc')
- 'gprintfint.h',
- 'gmirroringtable.h',
- 'gscripttable.h',
-+ 'gstrfuncsprivate.h',
- 'glib-mirroring-tab',
- 'gnulib',
- 'pcre',
-diff --git a/glib/gstrfuncsprivate.h b/glib/gstrfuncsprivate.h
-new file mode 100644
-index 000000000..85c88328a
---- /dev/null
-+++ b/glib/gstrfuncsprivate.h
-@@ -0,0 +1,55 @@
-+/* GLIB - Library of useful routines for C programming
-+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <glib.h>
-+#include <string.h>
-+
-+/*
-+ * g_memdup2:
-+ * @mem: (nullable): the memory to copy.
-+ * @byte_size: the number of bytes to copy.
-+ *
-+ * Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
-+ * from @mem. If @mem is %NULL it returns %NULL.
-+ *
-+ * This replaces g_memdup(), which was prone to integer overflows when
-+ * converting the argument from a #gsize to a #guint.
-+ *
-+ * This static inline version is a backport of the new public API from
-+ * GLib 2.68, kept internal to GLib for backport to older stable releases.
-+ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2319.
-+ *
-+ * Returns: (nullable): a pointer to the newly-allocated copy of the memory,
-+ * or %NULL if @mem is %NULL.
-+ * Since: 2.68
-+ */
-+static inline gpointer
-+g_memdup2 (gconstpointer mem,
-+ gsize byte_size)
-+{
-+ gpointer new_mem;
-+
-+ if (mem && byte_size != 0)
-+ {
-+ new_mem = g_malloc (byte_size);
-+ memcpy (new_mem, mem, byte_size);
-+ }
-+ else
-+ new_mem = NULL;
-+
-+ return new_mem;
-+}
-diff --git a/glib/meson.build b/glib/meson.build
-index aaf5f00f5..5a6eea397 100644
---- a/glib/meson.build
-+++ b/glib/meson.build
-@@ -268,6 +268,7 @@ glib_sources = files(
- 'gslist.c',
- 'gstdio.c',
- 'gstrfuncs.c',
-+ 'gstrfuncsprivate.h',
- 'gstring.c',
- 'gstringchunk.c',
- 'gtestutils.c',
-diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
-index e1f9619c7..d968afff9 100644
---- a/glib/tests/strfuncs.c
-+++ b/glib/tests/strfuncs.c
-@@ -32,6 +32,8 @@
- #include <string.h>
- #include "glib.h"
-
-+#include "gstrfuncsprivate.h"
-+
- #if defined (_MSC_VER) && (_MSC_VER <= 1800)
- #define isnan(x) _isnan(x)
-
-@@ -219,6 +221,26 @@ test_memdup (void)
- g_free (str_dup);
- }
-
-+/* Testing g_memdup2() function with various positive and negative cases */
-+static void
-+test_memdup2 (void)
-+{
-+ gchar *str_dup = NULL;
-+ const gchar *str = "The quick brown fox jumps over the lazy dog";
-+
-+ /* Testing negative cases */
-+ g_assert_null (g_memdup2 (NULL, 1024));
-+ g_assert_null (g_memdup2 (str, 0));
-+ g_assert_null (g_memdup2 (NULL, 0));
-+
-+ /* Testing normal usage cases */
-+ str_dup = g_memdup2 (str, strlen (str) + 1);
-+ g_assert_nonnull (str_dup);
-+ g_assert_cmpstr (str, ==, str_dup);
-+
-+ g_free (str_dup);
-+}
-+
- /* Testing g_strpcpy() function with various positive and negative cases */
- static void
- test_stpcpy (void)
-@@ -2523,6 +2545,7 @@ main (int argc,
- g_test_add_func ("/strfuncs/has-prefix", test_has_prefix);
- g_test_add_func ("/strfuncs/has-suffix", test_has_suffix);
- g_test_add_func ("/strfuncs/memdup", test_memdup);
-+ g_test_add_func ("/strfuncs/memdup2", test_memdup2);
- g_test_add_func ("/strfuncs/stpcpy", test_stpcpy);
- g_test_add_func ("/strfuncs/str_match_string", test_str_match_string);
- g_test_add_func ("/strfuncs/str_tokenize_and_fold", test_str_tokenize_and_fold);
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-02.patch b/gnu/packages/patches/glib-CVE-2021-27219-02.patch
deleted file mode 100644
index 431959fa8f..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-02.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-Backport of:
-
-From be8834340a2d928ece82025463ae23dee2c333d0 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:37:56 +0000
-Subject: [PATCH 02/11] gio: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdbusconnection.c | 5 +++--
- gio/gdbusinterfaceskeleton.c | 3 ++-
- gio/gfile.c | 7 ++++---
- gio/gsettingsschema.c | 5 +++--
- gio/gwin32registrykey.c | 8 +++++---
- gio/tests/async-close-output-stream.c | 6 ++++--
- gio/tests/gdbus-export.c | 5 +++--
- gio/win32/gwinhttpfile.c | 9 +++++----
- 8 files changed, 29 insertions(+), 19 deletions(-)
-
-diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
-index f1f0921d4..d56453486 100644
---- a/gio/gdbusconnection.c
-+++ b/gio/gdbusconnection.c
-@@ -110,6 +110,7 @@
- #include "gasyncinitable.h"
- #include "giostream.h"
- #include "gasyncresult.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gmarshal-internal.h"
-
-@@ -3997,7 +3998,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
- /* Don't waste memory by copying padding - remember to update this
- * when changing struct _GDBusInterfaceVTable in gdbusconnection.h
- */
-- return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+ return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
-
- static void
-@@ -4014,7 +4015,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
- /* Don't waste memory by copying padding - remember to update this
- * when changing struct _GDBusSubtreeVTable in gdbusconnection.h
- */
-- return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+ return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
-
- static void
-diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c
-index 4a06516c1..4a4b719a5 100644
---- a/gio/gdbusinterfaceskeleton.c
-+++ b/gio/gdbusinterfaceskeleton.c
-@@ -28,6 +28,7 @@
- #include "gdbusmethodinvocation.h"
- #include "gdbusconnection.h"
- #include "gmarshal-internal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gioerror.h"
-
-@@ -701,7 +702,7 @@ add_connection_locked (GDBusInterfaceSkeleton *interface_,
- * properly before building the hooked_vtable, so we create it
- * once at the last minute.
- */
-- interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
-+ interface_->priv->hooked_vtable = g_memdup2 (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
- interface_->priv->hooked_vtable->method_call = skeleton_intercept_handle_method_call;
- }
-
-diff --git a/gio/gfile.c b/gio/gfile.c
-index ba93f7c75..88b341e7d 100644
---- a/gio/gfile.c
-+++ b/gio/gfile.c
-@@ -60,6 +60,7 @@
- #include "gasyncresult.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
-
-
- /**
-@@ -7884,7 +7885,7 @@ measure_disk_usage_progress (gboolean reporting,
- g_main_context_invoke_full (g_task_get_context (task),
- g_task_get_priority (task),
- measure_disk_usage_invoke_progress,
-- g_memdup (&progress, sizeof progress),
-+ g_memdup2 (&progress, sizeof progress),
- g_free);
- }
-
-@@ -7902,7 +7903,7 @@ measure_disk_usage_thread (GTask *task,
- data->progress_callback ? measure_disk_usage_progress : NULL, task,
- &result.disk_usage, &result.num_dirs, &result.num_files,
- &error))
-- g_task_return_pointer (task, g_memdup (&result, sizeof result), g_free);
-+ g_task_return_pointer (task, g_memdup2 (&result, sizeof result), g_free);
- else
- g_task_return_error (task, error);
- }
-@@ -7926,7 +7927,7 @@ g_file_real_measure_disk_usage_async (GFile *file,
-
- task = g_task_new (file, cancellable, callback, user_data);
- g_task_set_source_tag (task, g_file_real_measure_disk_usage_async);
-- g_task_set_task_data (task, g_memdup (&data, sizeof data), g_free);
-+ g_task_set_task_data (task, g_memdup2 (&data, sizeof data), g_free);
- g_task_set_priority (task, io_priority);
-
- g_task_run_in_thread (task, measure_disk_usage_thread);
-diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
-index 3a60b8c64..dded9b1ca 100644
---- a/gio/gsettingsschema.c
-+++ b/gio/gsettingsschema.c
-@@ -20,6 +20,7 @@
-
- #include "gsettingsschema-internal.h"
- #include "gsettings.h"
-+#include "gstrfuncsprivate.h"
-
- #include "gvdb/gvdb-reader.h"
- #include "strinfo.c"
-@@ -1058,9 +1059,9 @@ g_settings_schema_list_children (GSettingsSchema *schema)
-
- if (g_str_has_suffix (key, "/"))
- {
-- gint length = strlen (key);
-+ gsize length = strlen (key);
-
-- strv[j] = g_memdup (key, length);
-+ strv[j] = g_memdup2 (key, length);
- strv[j][length - 1] = '\0';
- j++;
- }
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index c19fede4e..619fd48af 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -28,6 +28,8 @@
- #include <ntstatus.h>
- #include <winternl.h>
-
-+#include "gstrfuncsprivate.h"
-+
- #ifndef _WDMDDK_
- typedef enum _KEY_INFORMATION_CLASS {
- KeyBasicInformation,
-@@ -247,7 +249,7 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
- new_iter->value_name_size = iter->value_name_size;
-
- if (iter->value_data != NULL)
-- new_iter->value_data = g_memdup (iter->value_data, iter->value_data_size);
-+ new_iter->value_data = g_memdup2 (iter->value_data, iter->value_data_size);
-
- new_iter->value_data_size = iter->value_data_size;
-
-@@ -268,8 +270,8 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
- new_iter->value_data_expanded_charsize = iter->value_data_expanded_charsize;
-
- if (iter->value_data_expanded_u8 != NULL)
-- new_iter->value_data_expanded_u8 = g_memdup (iter->value_data_expanded_u8,
-- iter->value_data_expanded_charsize);
-+ new_iter->value_data_expanded_u8 = g_memdup2 (iter->value_data_expanded_u8,
-+ iter->value_data_expanded_charsize);
-
- new_iter->value_data_expanded_u8_size = iter->value_data_expanded_charsize;
-
-diff --git a/gio/tests/async-close-output-stream.c b/gio/tests/async-close-output-stream.c
-index 5f6620275..d3f97a119 100644
---- a/gio/tests/async-close-output-stream.c
-+++ b/gio/tests/async-close-output-stream.c
-@@ -24,6 +24,8 @@
- #include <stdlib.h>
- #include <string.h>
-
-+#include "gstrfuncsprivate.h"
-+
- #define DATA_TO_WRITE "Hello world\n"
-
- typedef struct
-@@ -147,9 +149,9 @@ prepare_data (SetupData *data,
-
- data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream));
-
-- g_assert_cmpint (data->expected_size, >, 0);
-+ g_assert_cmpuint (data->expected_size, >, 0);
-
-- data->expected_output = g_memdup (written, (guint)data->expected_size);
-+ data->expected_output = g_memdup2 (written, data->expected_size);
-
- /* then recreate the streams and prepare them for the asynchronous close */
- destroy_streams (data);
-diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c
-index 506c7458a..5513306f8 100644
---- a/gio/tests/gdbus-export.c
-+++ b/gio/tests/gdbus-export.c
-@@ -23,6 +23,7 @@
- #include <string.h>
-
- #include "gdbus-tests.h"
-+#include "gstrfuncsprivate.h"
-
- /* all tests rely on a shared mainloop */
- static GMainLoop *loop = NULL;
-@@ -671,7 +672,7 @@ subtree_introspect (GDBusConnection *connection,
- g_assert_not_reached ();
- }
-
-- return g_memdup (interfaces, 2 * sizeof (void *));
-+ return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
-
- static const GDBusInterfaceVTable *
-@@ -727,7 +728,7 @@ dynamic_subtree_introspect (GDBusConnection *connection,
- {
- const GDBusInterfaceInfo *interfaces[2] = { &dyna_interface_info, NULL };
-
-- return g_memdup (interfaces, 2 * sizeof (void *));
-+ return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
-
- static const GDBusInterfaceVTable *
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index cf5eed31d..040ee8564 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -29,6 +29,7 @@
- #include "gio/gfile.h"
- #include "gio/gfileattribute.h"
- #include "gio/gfileinfo.h"
-+#include "gstrfuncsprivate.h"
- #include "gwinhttpfile.h"
- #include "gwinhttpfileinputstream.h"
- #include "gwinhttpfileoutputstream.h"
-@@ -393,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile *file,
- child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
- child->vfs = winhttp_file->vfs;
- child->url = winhttp_file->url;
-- child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
-- child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
-- child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
-- child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+ child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
-+ child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
-+ child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
-+ child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
- child->url.lpszUrlPath = wnew_path;
- child->url.dwUrlPathLength = wcslen (wnew_path);
- child->url.lpszExtraInfo = NULL;
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-03.patch b/gnu/packages/patches/glib-CVE-2021-27219-03.patch
deleted file mode 100644
index 99e849c43c..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-03.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 6110caea45b235420b98cd41d845cc92238f6781 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:39:25 +0000
-Subject: [PATCH 03/11] gobject: Use g_memdup2() instead of g_memdup() in
- obvious places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gobject/gsignal.c | 3 ++-
- gobject/gtype.c | 9 +++++----
- gobject/gtypemodule.c | 3 ++-
- gobject/tests/param.c | 4 +++-
- 4 files changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/gobject/gsignal.c b/gobject/gsignal.c
-index 77d8f211e..41c54ab57 100644
---- a/gobject/gsignal.c
-+++ b/gobject/gsignal.c
-@@ -28,6 +28,7 @@
- #include <signal.h>
-
- #include "gsignal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtype-private.h"
- #include "gbsearcharray.h"
- #include "gvaluecollector.h"
-@@ -1730,7 +1731,7 @@ g_signal_newv (const gchar *signal_name,
- node->single_va_closure_is_valid = FALSE;
- node->flags = signal_flags & G_SIGNAL_FLAGS_MASK;
- node->n_params = n_params;
-- node->param_types = g_memdup (param_types, sizeof (GType) * n_params);
-+ node->param_types = g_memdup2 (param_types, sizeof (GType) * n_params);
- node->return_type = return_type;
- node->class_closure_bsa = NULL;
- if (accumulator)
-diff --git a/gobject/gtype.c b/gobject/gtype.c
-index 7d3789400..8441b90e9 100644
---- a/gobject/gtype.c
-+++ b/gobject/gtype.c
-@@ -33,6 +33,7 @@
-
- #include "glib-private.h"
- #include "gconstructor.h"
-+#include "gstrfuncsprivate.h"
-
- #ifdef G_OS_WIN32
- #include <windows.h>
-@@ -1470,7 +1471,7 @@ type_add_interface_Wm (TypeNode *node,
- iholder->next = iface_node_get_holders_L (iface);
- iface_node_set_holders_W (iface, iholder);
- iholder->instance_type = NODE_TYPE (node);
-- iholder->info = info ? g_memdup (info, sizeof (*info)) : NULL;
-+ iholder->info = info ? g_memdup2 (info, sizeof (*info)) : NULL;
- iholder->plugin = plugin;
-
- /* create an iface entry for this type */
-@@ -1731,7 +1732,7 @@ type_iface_retrieve_holder_info_Wm (TypeNode *iface,
- INVALID_RECURSION ("g_type_plugin_*", iholder->plugin, NODE_NAME (iface));
-
- check_interface_info_I (iface, instance_type, &tmp_info);
-- iholder->info = g_memdup (&tmp_info, sizeof (tmp_info));
-+ iholder->info = g_memdup2 (&tmp_info, sizeof (tmp_info));
- }
-
- return iholder; /* we don't modify write lock upon returning NULL */
-@@ -2016,10 +2017,10 @@ type_iface_vtable_base_init_Wm (TypeNode *iface,
- IFaceEntry *pentry = type_lookup_iface_entry_L (pnode, iface);
-
- if (pentry)
-- vtable = g_memdup (pentry->vtable, iface->data->iface.vtable_size);
-+ vtable = g_memdup2 (pentry->vtable, iface->data->iface.vtable_size);
- }
- if (!vtable)
-- vtable = g_memdup (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
-+ vtable = g_memdup2 (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
- entry->vtable = vtable;
- vtable->g_type = NODE_TYPE (iface);
- vtable->g_instance_type = NODE_TYPE (node);
-diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
-index 4ecaf8c88..20911fafd 100644
---- a/gobject/gtypemodule.c
-+++ b/gobject/gtypemodule.c
-@@ -19,6 +19,7 @@
-
- #include <stdlib.h>
-
-+#include "gstrfuncsprivate.h"
- #include "gtypeplugin.h"
- #include "gtypemodule.h"
-
-@@ -436,7 +437,7 @@ g_type_module_register_type (GTypeModule *module,
- module_type_info->loaded = TRUE;
- module_type_info->info = *type_info;
- if (type_info->value_table)
-- module_type_info->info.value_table = g_memdup (type_info->value_table,
-+ module_type_info->info.value_table = g_memdup2 (type_info->value_table,
- sizeof (GTypeValueTable));
-
- return module_type_info->type;
-diff --git a/gobject/tests/param.c b/gobject/tests/param.c
-index 758289bf8..971cff162 100644
---- a/gobject/tests/param.c
-+++ b/gobject/tests/param.c
-@@ -2,6 +2,8 @@
- #include <glib-object.h>
- #include <stdlib.h>
-
-+#include "gstrfuncsprivate.h"
-+
- static void
- test_param_value (void)
- {
-@@ -851,7 +853,7 @@ main (int argc, char *argv[])
- test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
- data.change_this_flag, data.change_this_type,
- data.use_this_flag, data.use_this_type);
-- test_data = g_memdup (&data, sizeof (TestParamImplementData));
-+ test_data = g_memdup2 (&data, sizeof (TestParamImplementData));
- g_test_add_data_func_full (test_path, test_data, test_param_implement_child, g_free);
- g_free (test_path);
- }
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-04.patch b/gnu/packages/patches/glib-CVE-2021-27219-04.patch
deleted file mode 100644
index 3ae01f34b1..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-04.patch
+++ /dev/null
@@ -1,308 +0,0 @@
-Backport of:
-
-From 0736b7c1e7cf4232c5d7eb2b0fbfe9be81bd3baa Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:41:21 +0000
-Subject: [PATCH 04/11] glib: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()` or an existing `gsize`
-variable), so that they use `g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it
-
-In particular, this fixes an overflow within `g_bytes_new()`, identified
-as GHSL-2021-045 by GHSL team member Kevin Backhouse.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Fixes: GHSL-2021-045
-Helps: #2319
----
- glib/gbytes.c | 6 ++++--
- glib/gdir.c | 3 ++-
- glib/ghash.c | 7 ++++---
- glib/giochannel.c | 3 ++-
- glib/gslice.c | 3 ++-
- glib/gtestutils.c | 3 ++-
- glib/gvariant.c | 7 ++++---
- glib/gvarianttype.c | 3 ++-
- glib/tests/array-test.c | 4 +++-
- glib/tests/option-context.c | 6 ++++--
- 10 files changed, 29 insertions(+), 16 deletions(-)
-
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index d56abe6c3..dee494820 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -34,6 +34,8 @@
-
- #include <string.h>
-
-+#include "gstrfuncsprivate.h"
-+
- /**
- * GBytes:
- *
-@@ -95,7 +97,7 @@ g_bytes_new (gconstpointer data,
- {
- g_return_val_if_fail (data != NULL || size == 0, NULL);
-
-- return g_bytes_new_take (g_memdup (data, size), size);
-+ return g_bytes_new_take (g_memdup2 (data, size), size);
- }
-
- /**
-@@ -499,7 +501,7 @@ g_bytes_unref_to_data (GBytes *bytes,
- * Copy: Non g_malloc (or compatible) allocator, or static memory,
- * so we have to copy, and then unref.
- */
-- result = g_memdup (bytes->data, bytes->size);
-+ result = g_memdup2 (bytes->data, bytes->size);
- *size = bytes->size;
- g_bytes_unref (bytes);
- }
-diff --git a/glib/gdir.c b/glib/gdir.c
-index 6b85e99c8..6747a8c6f 100644
---- a/glib/gdir.c
-+++ b/glib/gdir.c
-@@ -37,6 +37,7 @@
- #include "gconvert.h"
- #include "gfileutils.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
-
-@@ -112,7 +113,7 @@ g_dir_open_with_errno (const gchar *path,
- return NULL;
- #endif
-
-- return g_memdup (&dir, sizeof dir);
-+ return g_memdup2 (&dir, sizeof dir);
- }
-
- /**
-diff --git a/glib/ghash.c b/glib/ghash.c
-index e61b03788..26f26062b 100644
---- a/glib/ghash.c
-+++ b/glib/ghash.c
-@@ -34,6 +34,7 @@
- #include "gmacros.h"
- #include "glib-private.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gatomic.h"
- #include "gtestutils.h"
- #include "gslice.h"
-@@ -964,7 +965,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
- if (hash_table->have_big_keys)
- {
- if (key != value)
-- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
- /* Keys and values are both big now, so no need for further checks */
- return;
- }
-@@ -972,7 +973,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
- {
- if (key != value)
- {
-- hash_table->values = g_memdup (hash_table->keys, sizeof (guint) * hash_table->size);
-+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (guint) * hash_table->size);
- is_a_set = FALSE;
- }
- }
-@@ -1000,7 +1001,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
-
- /* Just split if necessary */
- if (is_a_set && key != value)
-- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
-
- #endif
- }
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 1956e9dc6..15927c391 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -37,6 +37,7 @@
- #include "giochannel.h"
-
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
-
-@@ -892,7 +893,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
- length = strlen (line_term);
-
- g_free (channel->line_term);
-- channel->line_term = line_term ? g_memdup (line_term, length) : NULL;
-+ channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
- channel->line_term_len = length;
- }
-
-diff --git a/glib/gslice.c b/glib/gslice.c
-index 4c758c3be..bcdbb8853 100644
---- a/glib/gslice.c
-+++ b/glib/gslice.c
-@@ -41,6 +41,7 @@
- #include "gmain.h"
- #include "gmem.h" /* gslice.h */
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gutils.h"
- #include "gtrashstack.h"
- #include "gtestutils.h"
-@@ -350,7 +351,7 @@ g_slice_get_config_state (GSliceConfig ckey,
- array[i++] = allocator->contention_counters[address];
- array[i++] = allocator_get_magazine_threshold (allocator, address);
- *n_values = i;
-- return g_memdup (array, sizeof (array[0]) * *n_values);
-+ return g_memdup2 (array, sizeof (array[0]) * *n_values);
- default:
- return NULL;
- }
-diff --git a/glib/gtestutils.c b/glib/gtestutils.c
-index dd789482f..5887ecc36 100644
---- a/glib/gtestutils.c
-+++ b/glib/gtestutils.c
-@@ -49,6 +49,7 @@
- #include "gpattern.h"
- #include "grand.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtimer.h"
- #include "gslice.h"
- #include "gspawn.h"
-@@ -3798,7 +3799,7 @@ g_test_log_extract (GTestLogBuffer *tbuffer)
- if (p <= tbuffer->data->str + mlength)
- {
- g_string_erase (tbuffer->data, 0, mlength);
-- tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup (&msg, sizeof (msg)));
-+ tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup2 (&msg, sizeof (msg)));
- return TRUE;
- }
-
-diff --git a/glib/gvariant.c b/glib/gvariant.c
-index b61bf7278..d6f68a9ea 100644
---- a/glib/gvariant.c
-+++ b/glib/gvariant.c
-@@ -33,6 +33,7 @@
-
- #include <string.h>
-
-+#include "gstrfuncsprivate.h"
-
- /**
- * SECTION:gvariant
-@@ -725,7 +726,7 @@ g_variant_new_variant (GVariant *value)
- g_variant_ref_sink (value);
-
- return g_variant_new_from_children (G_VARIANT_TYPE_VARIANT,
-- g_memdup (&value, sizeof value),
-+ g_memdup2 (&value, sizeof value),
- 1, g_variant_is_trusted (value));
- }
-
-@@ -1229,7 +1230,7 @@ g_variant_new_fixed_array (const GVariantType *element_type,
- return NULL;
- }
-
-- data = g_memdup (elements, n_elements * element_size);
-+ data = g_memdup2 (elements, n_elements * element_size);
- value = g_variant_new_from_data (array_type, data,
- n_elements * element_size,
- FALSE, g_free, data);
-@@ -1908,7 +1909,7 @@ g_variant_dup_bytestring (GVariant *value,
- if (length)
- *length = size;
-
-- return g_memdup (original, size + 1);
-+ return g_memdup2 (original, size + 1);
- }
-
- /**
-diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
-index 1a228f73b..07659ff12 100644
---- a/glib/gvarianttype.c
-+++ b/glib/gvarianttype.c
-@@ -28,6 +28,7 @@
-
- #include <string.h>
-
-+#include "gstrfuncsprivate.h"
-
- /**
- * SECTION:gvarianttype
-@@ -1181,7 +1182,7 @@ g_variant_type_new_tuple (const GVariantType * const *items,
- g_assert (offset < sizeof buffer);
- buffer[offset++] = ')';
-
-- return (GVariantType *) g_memdup (buffer, offset);
-+ return (GVariantType *) g_memdup2 (buffer, offset);
- }
-
- /**
-diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
-index 3fcf1136a..11982f822 100644
---- a/glib/tests/array-test.c
-+++ b/glib/tests/array-test.c
-@@ -29,6 +29,8 @@
- #include <string.h>
- #include "glib.h"
-
-+#include "gstrfuncsprivate.h"
-+
- /* Test data to be passed to any function which calls g_array_new(), providing
- * the parameters for that call. Most #GArray tests should be repeated for all
- * possible values of #ArrayTestData. */
-@@ -1642,7 +1644,7 @@ byte_array_new_take (void)
- GByteArray *gbarray;
- guint8 *data;
-
-- data = g_memdup ("woooweeewow", 11);
-+ data = g_memdup2 ("woooweeewow", 11);
- gbarray = g_byte_array_new_take (data, 11);
- g_assert (gbarray->data == data);
- g_assert_cmpuint (gbarray->len, ==, 11);
-diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
-index 149d22353..88d2b80d1 100644
---- a/glib/tests/option-context.c
-+++ b/glib/tests/option-context.c
-@@ -27,6 +27,8 @@
- #include <string.h>
- #include <locale.h>
-
-+#include "gstrfuncsprivate.h"
-+
- static GOptionEntry main_entries[] = {
- { "main-switch", 0, 0,
- G_OPTION_ARG_NONE, NULL,
-@@ -256,7 +258,7 @@ join_stringv (int argc, char **argv)
- static char **
- copy_stringv (char **argv, int argc)
- {
-- return g_memdup (argv, sizeof (char *) * (argc + 1));
-+ return g_memdup2 (argv, sizeof (char *) * (argc + 1));
- }
-
- static void
-@@ -2323,7 +2325,7 @@ test_group_parse (void)
- g_option_context_add_group (context, group);
-
- argv = split_string ("program --test arg1 -f arg2 --group-test arg3 --frob arg4 -z arg5", &argc);
-- orig_argv = g_memdup (argv, (argc + 1) * sizeof (char *));
-+ orig_argv = g_memdup2 (argv, (argc + 1) * sizeof (char *));
-
- retval = g_option_context_parse (context, &argc, &argv, &error);
-
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-05.patch b/gnu/packages/patches/glib-CVE-2021-27219-05.patch
deleted file mode 100644
index 62bce1b188..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-05.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 0cbad673215ec8a049b7fe2ff44b0beed31b376e Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 16:12:24 +0000
-Subject: [PATCH 05/11] gwinhttpfile: Avoid arithmetic overflow when
- calculating a size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The members of `URL_COMPONENTS` (`winhttp_file->url`) are `DWORD`s, i.e.
-32-bit unsigned integers. Adding to and multiplying them may cause them
-to overflow the unsigned integer bounds, even if the result is passed to
-`g_memdup2()` which accepts a `gsize`.
-
-Cast the `URL_COMPONENTS` members to `gsize` first to ensure that the
-arithmetic is done in terms of `gsize`s rather than unsigned integers.
-
-Spotted by Sebastian Dröge.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/win32/gwinhttpfile.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index 040ee8564..246ec0578 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -394,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile *file,
- child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
- child->vfs = winhttp_file->vfs;
- child->url = winhttp_file->url;
-- child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
-- child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
-- child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
-- child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+ child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, ((gsize) winhttp_file->url.dwSchemeLength + 1) * 2);
-+ child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, ((gsize) winhttp_file->url.dwHostNameLength + 1) * 2);
-+ child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, ((gsize) winhttp_file->url.dwUserNameLength + 1) * 2);
-+ child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, ((gsize) winhttp_file->url.dwPasswordLength + 1) * 2);
- child->url.lpszUrlPath = wnew_path;
- child->url.dwUrlPathLength = wcslen (wnew_path);
- child->url.lpszExtraInfo = NULL;
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-06.patch b/gnu/packages/patches/glib-CVE-2021-27219-06.patch
deleted file mode 100644
index 4e2435f5fd..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-06.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From f9ee2275cbc312c0b4cdbc338a4fbb76eb36fb9a Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:49:00 +0000
-Subject: [PATCH 06/11] gdatainputstream: Handle stop_chars_len internally as
- gsize
-
-Previously it was handled as a `gssize`, which meant that if the
-`stop_chars` string was longer than `G_MAXSSIZE` there would be an
-overflow.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdatainputstream.c | 25 +++++++++++++++++--------
- 1 file changed, 17 insertions(+), 8 deletions(-)
-
-diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
-index 2e7750cb5..2cdcbda19 100644
---- a/gio/gdatainputstream.c
-+++ b/gio/gdatainputstream.c
-@@ -27,6 +27,7 @@
- #include "gioenumtypes.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
-
- #include <string.h>
-
-@@ -856,7 +857,7 @@ static gssize
- scan_for_chars (GDataInputStream *stream,
- gsize *checked_out,
- const char *stop_chars,
-- gssize stop_chars_len)
-+ gsize stop_chars_len)
- {
- GBufferedInputStream *bstream;
- const char *buffer;
-@@ -952,7 +953,7 @@ typedef struct
- gsize checked;
-
- gchar *stop_chars;
-- gssize stop_chars_len;
-+ gsize stop_chars_len;
- gsize length;
- } GDataInputStreamReadData;
-
-@@ -1078,12 +1079,17 @@ g_data_input_stream_read_async (GDataInputStream *stream,
- {
- GDataInputStreamReadData *data;
- GTask *task;
-+ gsize stop_chars_len_unsigned;
-
- data = g_slice_new0 (GDataInputStreamReadData);
-- if (stop_chars_len == -1)
-- stop_chars_len = strlen (stop_chars);
-- data->stop_chars = g_memdup (stop_chars, stop_chars_len);
-- data->stop_chars_len = stop_chars_len;
-+
-+ if (stop_chars_len < 0)
-+ stop_chars_len_unsigned = strlen (stop_chars);
-+ else
-+ stop_chars_len_unsigned = (gsize) stop_chars_len;
-+
-+ data->stop_chars = g_memdup2 (stop_chars, stop_chars_len_unsigned);
-+ data->stop_chars_len = stop_chars_len_unsigned;
- data->last_saw_cr = FALSE;
-
- task = g_task_new (stream, cancellable, callback, user_data);
-@@ -1338,17 +1344,20 @@ g_data_input_stream_read_upto (GDataInputStream *stream,
- gssize found_pos;
- gssize res;
- char *data_until;
-+ gsize stop_chars_len_unsigned;
-
- g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL);
-
- if (stop_chars_len < 0)
-- stop_chars_len = strlen (stop_chars);
-+ stop_chars_len_unsigned = strlen (stop_chars);
-+ else
-+ stop_chars_len_unsigned = (gsize) stop_chars_len;
-
- bstream = G_BUFFERED_INPUT_STREAM (stream);
-
- checked = 0;
-
-- while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len)) == -1)
-+ while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len_unsigned)) == -1)
- {
- if (g_buffered_input_stream_get_available (bstream) ==
- g_buffered_input_stream_get_buffer_size (bstream))
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-07.patch b/gnu/packages/patches/glib-CVE-2021-27219-07.patch
deleted file mode 100644
index dad3d285f4..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-07.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-Backport of:
-
-From 2aaf593a9eb96d84fe3be740aca2810a97d95592 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:50:37 +0000
-Subject: [PATCH 07/11] gwin32: Use gsize internally in g_wcsdup()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows it to handle strings up to length `G_MAXSIZE` — previously
-it would overflow with such strings.
-
-Update the several copies of it identically.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gwin32appinfo.c | 33 ++++++++++++++++++++++++++-------
- gio/gwin32registrykey.c | 34 ++++++++++++++++++++++++++--------
- 2 files changed, 52 insertions(+), 15 deletions(-)
-
-diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
-index 9f335b370..dd7a96a4a 100644
---- a/gio/gwin32appinfo.c
-+++ b/gio/gwin32appinfo.c
-@@ -464,15 +464,34 @@ static GWin32RegistryKey *applications_key;
- /* Watch this key */
- static GWin32RegistryKey *classes_root_key;
-
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+ gsize result;
-+
-+ for (result = 0; str[0] != 0; str++, result++)
-+ ;
-+
-+ return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str, gssize str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
-- if (str_size == -1)
-- {
-- str_size = wcslen (str) + 1;
-- str_size *= sizeof (gunichar2);
-- }
-- return g_memdup (str, str_size);
-+ gsize str_len_unsigned;
-+ gsize str_size;
-+
-+ g_return_val_if_fail (str != NULL, NULL);
-+
-+ if (str_len < 0)
-+ str_len_unsigned = g_utf16_len (str);
-+ else
-+ str_len_unsigned = (gsize) str_len;
-+
-+ g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+ str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+ return g_memdup2 (str, str_size);
- }
-
- #define URL_ASSOCIATIONS L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\"
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index 619fd48af..fbd65311a 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -127,16 +127,34 @@ typedef enum
- G_WIN32_REGISTRY_UPDATED_PATH = 1,
- } GWin32RegistryKeyUpdateFlag;
-
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+ gsize result;
-+
-+ for (result = 0; str[0] != 0; str++, result++)
-+ ;
-+
-+ return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str,
-- gssize str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
-- if (str_size == -1)
-- {
-- str_size = wcslen (str) + 1;
-- str_size *= sizeof (gunichar2);
-- }
-- return g_memdup (str, str_size);
-+ gsize str_len_unsigned;
-+ gsize str_size;
-+
-+ g_return_val_if_fail (str != NULL, NULL);
-+
-+ if (str_len < 0)
-+ str_len_unsigned = g_utf16_len (str);
-+ else
-+ str_len_unsigned = (gsize) str_len;
-+
-+ g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+ str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+ return g_memdup2 (str, str_size);
- }
-
- /**
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-08.patch b/gnu/packages/patches/glib-CVE-2021-27219-08.patch
deleted file mode 100644
index 2c021ad317..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-08.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From ba8ca443051f93a74c0d03d62e70402036f967a5 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:58:32 +0000
-Subject: [PATCH 08/11] gkeyfilesettingsbackend: Handle long keys when
- converting paths
-
-Previously, the code in `convert_path()` could not handle keys longer
-than `G_MAXINT`, and would overflow if that was exceeded.
-
-Convert the code to use `gsize` and `g_memdup2()` throughout, and
-change from identifying the position of the final slash in the string
-using a signed offset `i`, to using a pointer to the character (and
-`strrchr()`). This allows the slash to be at any position in a
-`G_MAXSIZE`-long string, without sacrificing a bit of the offset for
-indicating whether a slash was found.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gkeyfilesettingsbackend.c | 21 ++++++++++-----------
- 1 file changed, 10 insertions(+), 11 deletions(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index cd5765afd..25b057672 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -33,6 +33,7 @@
- #include "gfilemonitor.h"
- #include "gsimplepermission.h"
- #include "gsettingsbackendinternal.h"
-+#include "gstrfuncsprivate.h"
- #include "giomodule-priv.h"
- #include "gportalsupport.h"
-
-@@ -145,8 +146,8 @@ convert_path (GKeyfileSettingsBackend *kfsb,
- gchar **group,
- gchar **basename)
- {
-- gint key_len = strlen (key);
-- gint i;
-+ gsize key_len = strlen (key);
-+ const gchar *last_slash;
-
- if (key_len < kfsb->prefix_len ||
- memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0)
-@@ -155,38 +156,36 @@ convert_path (GKeyfileSettingsBackend *kfsb,
- key_len -= kfsb->prefix_len;
- key += kfsb->prefix_len;
-
-- for (i = key_len; i >= 0; i--)
-- if (key[i] == '/')
-- break;
-+ last_slash = strrchr (key, '/');
-
- if (kfsb->root_group)
- {
- /* if a root_group was specified, make sure the user hasn't given
- * a path that ghosts that group name
- */
-- if (i == kfsb->root_group_len && memcmp (key, kfsb->root_group, i) == 0)
-+ if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
- return FALSE;
- }
- else
- {
- /* if no root_group was given, ensure that the user gave a path */
-- if (i == -1)
-+ if (last_slash == NULL)
- return FALSE;
- }
-
- if (group)
- {
-- if (i >= 0)
-+ if (last_slash != NULL)
- {
-- *group = g_memdup (key, i + 1);
-- (*group)[i] = '\0';
-+ *group = g_memdup2 (key, (last_slash - key) + 1);
-+ (*group)[(last_slash - key)] = '\0';
- }
- else
- *group = g_strdup (kfsb->root_group);
- }
-
- if (basename)
-- *basename = g_memdup (key + i + 1, key_len - i);
-+ *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-
- return TRUE;
- }
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-09.patch b/gnu/packages/patches/glib-CVE-2021-27219-09.patch
deleted file mode 100644
index 4de0c1b349..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-09.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 65ec7f4d6e8832c481f6e00e2eb007b9a60024ce Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:00:53 +0000
-Subject: [PATCH 09/11] gsocket: Use gsize to track native sockaddr's size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Don’t use an `int`, that’s potentially too small. In practical terms,
-this is not a problem, since no socket address is going to be that big.
-
-By making these changes we can use `g_memdup2()` without warnings,
-though. Fewer warnings is good.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gsocket.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gsocket.c b/gio/gsocket.c
-index 66073af83..a3af149e8 100644
---- a/gio/gsocket.c
-+++ b/gio/gsocket.c
-@@ -75,6 +75,7 @@
- #include "gcredentialsprivate.h"
- #include "glibintl.h"
- #include "gioprivate.h"
-+#include "gstrfuncsprivate.h"
-
- #ifdef G_OS_WIN32
- /* For Windows XP runtime compatibility, but use the system's if_nametoindex() if available */
-@@ -174,7 +175,7 @@ static gboolean g_socket_datagram_based_condition_wait (GDatagramBased
- GError **error);
-
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len);
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len);
-
- static gssize
- g_socket_receive_message_with_timeout (GSocket *socket,
-@@ -260,7 +261,7 @@ struct _GSocketPrivate
- struct {
- GSocketAddress *addr;
- struct sockaddr *native;
-- gint native_len;
-+ gsize native_len;
- guint64 last_used;
- } recv_addr_cache[RECV_ADDR_CACHE_SIZE];
- };
-@@ -5211,14 +5212,14 @@ g_socket_send_messages_with_timeout (GSocket *socket,
- }
-
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len)
- {
- GSocketAddress *saddr;
- gint i;
- guint64 oldest_time = G_MAXUINT64;
- gint oldest_index = 0;
-
-- if (native_len <= 0)
-+ if (native_len == 0)
- return NULL;
-
- saddr = NULL;
-@@ -5226,7 +5227,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
- {
- GSocketAddress *tmp = socket->priv->recv_addr_cache[i].addr;
- gpointer tmp_native = socket->priv->recv_addr_cache[i].native;
-- gint tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
-+ gsize tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
-
- if (!tmp)
- continue;
-@@ -5256,7 +5257,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
- g_free (socket->priv->recv_addr_cache[oldest_index].native);
- }
-
-- socket->priv->recv_addr_cache[oldest_index].native = g_memdup (native, native_len);
-+ socket->priv->recv_addr_cache[oldest_index].native = g_memdup2 (native, native_len);
- socket->priv->recv_addr_cache[oldest_index].native_len = native_len;
- socket->priv->recv_addr_cache[oldest_index].addr = g_object_ref (saddr);
- socket->priv->recv_addr_cache[oldest_index].last_used = g_get_monotonic_time ();
-@@ -5404,6 +5405,9 @@ g_socket_receive_message_with_timeout (GSocket *socket,
- /* do it */
- while (1)
- {
-+ /* addrlen has to be of type int because that’s how WSARecvFrom() is defined */
-+ G_STATIC_ASSERT (sizeof addr <= G_MAXINT);
-+
- addrlen = sizeof addr;
- if (address)
- result = WSARecvFrom (socket->priv->fd,
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-10.patch b/gnu/packages/patches/glib-CVE-2021-27219-10.patch
deleted file mode 100644
index 36198b8eef..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-10.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 777b95a88f006d39d9fe6d3321db17e7b0d4b9a4 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:07:39 +0000
-Subject: [PATCH 10/11] gtlspassword: Forbid very long TLS passwords
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `g_tls_password_set_value_full()` (and the vfunc it
-invokes) can only accept a `gssize` length. Ensure that nul-terminated
-strings passed to `g_tls_password_set_value()` can’t exceed that length.
-Use `g_memdup2()` to avoid an overflow if they’re longer than
-`G_MAXUINT` similarly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gtlspassword.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index 1e437a7b6..dbcec41a8 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -23,6 +23,7 @@
- #include "glibintl.h"
-
- #include "gioenumtypes.h"
-+#include "gstrfuncsprivate.h"
- #include "gtlspassword.h"
-
- #include <string.h>
-@@ -287,9 +288,14 @@ g_tls_password_set_value (GTlsPassword *password,
- g_return_if_fail (G_IS_TLS_PASSWORD (password));
-
- if (length < 0)
-- length = strlen ((gchar *)value);
-+ {
-+ /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
-+ gsize length_unsigned = strlen ((gchar *) value);
-+ g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+ length = (gssize) length_unsigned;
-+ }
-
-- g_tls_password_set_value_full (password, g_memdup (value, length), length, g_free);
-+ g_tls_password_set_value_full (password, g_memdup2 (value, (gsize) length), length, g_free);
- }
-
- /**
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-11.patch b/gnu/packages/patches/glib-CVE-2021-27219-11.patch
deleted file mode 100644
index 4413cb9827..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-11.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ecdf91400e9a538695a0895b95ad7e8abcdf1749 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:09:40 +0000
-Subject: [PATCH 11/11] giochannel: Forbid very long line terminator strings
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `GIOChannel.line_term_len` is only a `guint`. Ensure that
-nul-terminated strings passed to `g_io_channel_set_line_term()` can’t
-exceed that length. Use `g_memdup2()` to avoid a warning (`g_memdup()`
-is due to be deprecated), but not to avoid a bug, since it’s also
-limited to `G_MAXUINT`.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- glib/giochannel.c | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 15927c391..66c6591f0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -884,16 +884,25 @@ g_io_channel_set_line_term (GIOChannel *channel,
- const gchar *line_term,
- gint length)
- {
-+ guint length_unsigned;
-+
- g_return_if_fail (channel != NULL);
- g_return_if_fail (line_term == NULL || length != 0); /* Disallow "" */
-
- if (line_term == NULL)
-- length = 0;
-- else if (length < 0)
-- length = strlen (line_term);
-+ length_unsigned = 0;
-+ else if (length >= 0)
-+ length_unsigned = (guint) length;
-+ else
-+ {
-+ /* FIXME: We’re constrained by line_term_len being a guint here */
-+ gsize length_size = strlen (line_term);
-+ g_return_if_fail (length_size > G_MAXUINT);
-+ length_unsigned = (guint) length_size;
-+ }
-
- g_free (channel->line_term);
-- channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
-+ channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
- channel->line_term_len = length;
- }
-
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-12.patch b/gnu/packages/patches/glib-CVE-2021-27219-12.patch
deleted file mode 100644
index 4fdbb81750..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-12.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f8273b9aded135fe07094faebd527e43851aaf6e Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Sun, 7 Feb 2021 23:32:40 +0100
-Subject: [PATCH 1/5] giochannel: Fix length_size bounds check
-
-The inverted condition is an obvious error introduced by ecdf91400e9a.
-
-Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-
-(cherry picked from commit a149bf2f9030168051942124536e303af8ba6176)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 66c6591f0..0d9d5f223 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -897,7 +897,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
- {
- /* FIXME: We’re constrained by line_term_len being a guint here */
- gsize length_size = strlen (line_term);
-- g_return_if_fail (length_size > G_MAXUINT);
-+ g_return_if_fail (length_size <= G_MAXUINT);
- length_unsigned = (guint) length_size;
- }
-
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-13.patch b/gnu/packages/patches/glib-CVE-2021-27219-13.patch
deleted file mode 100644
index 6a287cc3a2..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-13.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e069c50467712e6d607822afd6b6c15c2c343dff Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:34:50 +0000
-Subject: [PATCH 2/5] giochannel: Don't store negative line_term_len in
- GIOChannel struct
-
-Adding test coverage indicated that this was another bug in 0cc11f74.
-
-Fixes: 0cc11f74 "giochannel: Forbid very long line terminator strings"
-Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 5dc8b0014c03e7491d93b90275ab442e888a9628)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 0d9d5f223..4c39b9dc0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -903,7 +903,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
-
- g_free (channel->line_term);
- channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
-- channel->line_term_len = length;
-+ channel->line_term_len = length_unsigned;
- }
-
- /**
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-14.patch b/gnu/packages/patches/glib-CVE-2021-27219-14.patch
deleted file mode 100644
index 78de2846da..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-14.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4506d1859a863087598c8d122740bae25b65b099 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:04:48 +0000
-Subject: [PATCH 4/5] gtlspassword: Fix inverted assertion
-
-The intention here was to assert that the length of the password fits
-in a gssize. Passwords more than half the size of virtual memory are
-probably excessive.
-
-Fixes: a8b204ff "gtlspassword: Forbid very long TLS passwords"
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 61bb52ec42de1082bfb06ce1c737fc295bfe60b8)
----
- gio/gtlspassword.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index dbcec41a8..bd86a6dfe 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -291,7 +291,7 @@ g_tls_password_set_value (GTlsPassword *password,
- {
- /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
- gsize length_unsigned = strlen ((gchar *) value);
-- g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+ g_return_if_fail (length_unsigned <= G_MAXSSIZE);
- length = (gssize) length_unsigned;
- }
-
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-15.patch b/gnu/packages/patches/glib-CVE-2021-27219-15.patch
deleted file mode 100644
index 37ef85b4fa..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-15.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 3d1550354c3c6a8491c39881752d51cb7515f2c2 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:22:39 +0000
-Subject: [PATCH 5/5] tls-interaction: Add test coverage for various ways to
- set the password
-
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit df4501316ca3903072400504a5ea76498db19538)
----
- gio/tests/tls-interaction.c | 55 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 55 insertions(+)
-
-diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c
-index 4f0737d7e..5661e8e0d 100644
---- a/gio/tests/tls-interaction.c
-+++ b/gio/tests/tls-interaction.c
-@@ -174,6 +174,38 @@ test_interaction_ask_password_finish_failure (GTlsInteraction *interaction,
- }
-
-
-+/* Return a copy of @str that is allocated in a silly way, to exercise
-+ * custom free-functions. The returned pointer points to a copy of @str
-+ * in a buffer of the form "BEFORE \0 str \0 AFTER". */
-+static guchar *
-+special_dup (const char *str)
-+{
-+ GString *buf = g_string_new ("BEFORE");
-+ guchar *ret;
-+
-+ g_string_append_c (buf, '\0');
-+ g_string_append (buf, str);
-+ g_string_append_c (buf, '\0');
-+ g_string_append (buf, "AFTER");
-+ ret = (guchar *) g_string_free (buf, FALSE);
-+ return ret + strlen ("BEFORE") + 1;
-+}
-+
-+
-+/* Free a copy of @str that was made with special_dup(), after asserting
-+ * that it has not been corrupted. */
-+static void
-+special_free (gpointer p)
-+{
-+ gchar *s = p;
-+ gchar *buf = s - strlen ("BEFORE") - 1;
-+
-+ g_assert_cmpstr (buf, ==, "BEFORE");
-+ g_assert_cmpstr (s + strlen (s) + 1, ==, "AFTER");
-+ g_free (buf);
-+}
-+
-+
- static GTlsInteractionResult
- test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
- GTlsPassword *password,
-@@ -181,6 +213,8 @@ test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
- GError **error)
- {
- TestInteraction *self;
-+ const guchar *value;
-+ gsize len;
-
- g_assert (TEST_IS_INTERACTION (interaction));
- self = TEST_INTERACTION (interaction);
-@@ -192,6 +226,27 @@ test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
- g_assert (error != NULL);
- g_assert (*error == NULL);
-
-+ /* Exercise different ways to set the value */
-+ g_tls_password_set_value (password, (const guchar *) "foo", 4);
-+ len = 0;
-+ value = g_tls_password_get_value (password, &len);
-+ g_assert_cmpmem (value, len, "foo", 4);
-+
-+ g_tls_password_set_value (password, (const guchar *) "bar", -1);
-+ len = 0;
-+ value = g_tls_password_get_value (password, &len);
-+ g_assert_cmpmem (value, len, "bar", 3);
-+
-+ g_tls_password_set_value_full (password, special_dup ("baa"), 4, special_free);
-+ len = 0;
-+ value = g_tls_password_get_value (password, &len);
-+ g_assert_cmpmem (value, len, "baa", 4);
-+
-+ g_tls_password_set_value_full (password, special_dup ("baz"), -1, special_free);
-+ len = 0;
-+ value = g_tls_password_get_value (password, &len);
-+ g_assert_cmpmem (value, len, "baz", 3);
-+
- /* Don't do this in real life. Include a null terminator for testing */
- g_tls_password_set_value (password, (const guchar *)"the password", 13);
- return G_TLS_INTERACTION_HANDLED;
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-16.patch b/gnu/packages/patches/glib-CVE-2021-27219-16.patch
deleted file mode 100644
index 43635e72ed..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-16.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From cb9ee701ef46c1819eed4e2a4dc181682bdfc176 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:16:39 +0000
-Subject: [PATCH 1/3] gkeyfilesettingsbackend: Fix basename handling when group
- is unset
-
-Fix an effective regression in commit
-7781a9cbd2fd0aa84bee0f4eee88470640ff6706, which happens when
-`convert_path()` is called with a `key` which contains no slashes. In
-that case, the `key` is entirely the `basename`.
-
-Prior to commit 7781a9cb, the code worked through a fluke of `i == -1`
-cancelling out with the various additions in the `g_memdup()` call, and
-effectively resulting in `g_strdup (key)`.
-
-Spotted by Guido Berhoerster.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 25b057672..861c3a661 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -185,7 +185,12 @@ convert_path (GKeyfileSettingsBackend *kfsb,
- }
-
- if (basename)
-- *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+ {
-+ if (last_slash != NULL)
-+ *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+ else
-+ *basename = g_strdup (key);
-+ }
-
- return TRUE;
- }
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-17.patch b/gnu/packages/patches/glib-CVE-2021-27219-17.patch
deleted file mode 100644
index 3153979071..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-17.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 31e0d403ba635dbbacbfbff74295e5db02558d76 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:19:30 +0000
-Subject: [PATCH 2/3] gkeyfilesettingsbackend: Disallow empty key or group
- names
-
-These should never have been allowed; they will result in precondition
-failures from the `GKeyFile` later on in the code.
-
-A test will be added for this shortly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 861c3a661..de216e615 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -158,6 +158,13 @@ convert_path (GKeyfileSettingsBackend *kfsb,
-
- last_slash = strrchr (key, '/');
-
-+ /* Disallow empty group names or key names */
-+ if (key_len == 0 ||
-+ (last_slash != NULL &&
-+ (*(last_slash + 1) == '\0' ||
-+ last_slash == key)))
-+ return FALSE;
-+
- if (kfsb->root_group)
- {
- /* if a root_group was specified, make sure the user hasn't given
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-18.patch b/gnu/packages/patches/glib-CVE-2021-27219-18.patch
deleted file mode 100644
index c18d44ddeb..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-18.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-Backport of:
-
-From 221c26685354dea2b2732df94404e8e5e77a1591 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:21:36 +0000
-Subject: [PATCH 3/3] tests: Add tests for key name handling in the keyfile
- backend
-
-This tests the two recent commits.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/tests/gsettings.c | 171 +++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 170 insertions(+), 1 deletion(-)
-
-diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
-index baadca8f5..afe594a23 100644
---- a/gio/tests/gsettings.c
-+++ b/gio/tests/gsettings.c
-@@ -1,3 +1,4 @@
-+#include <errno.h>
- #include <stdlib.h>
- #include <locale.h>
- #include <libintl.h>
-@@ -1740,6 +1741,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data)
- (*b) = TRUE;
- }
-
-+typedef struct
-+{
-+ const gchar *path;
-+ const gchar *root_group;
-+ const gchar *keyfile_group;
-+ const gchar *root_path;
-+} KeyfileTestData;
-+
- /*
- * Test that using a keyfile works
- */
-@@ -1834,7 +1843,11 @@ test_keyfile (Fixture *fixture,
- g_free (str);
-
- g_settings_set (settings, "farewell", "s", "cheerio");
--
-+
-+ /* Check that empty keys/groups are not allowed. */
-+ g_assert_false (g_settings_is_writable (settings, ""));
-+ g_assert_false (g_settings_is_writable (settings, "/"));
-+
- /* When executing as root, changing the mode of the keyfile will have
- * no effect on the writability of the settings.
- */
-@@ -1866,6 +1879,149 @@ test_keyfile (Fixture *fixture,
- g_free (keyfile_path);
- }
-
-+/*
-+ * Test that using a keyfile works with a schema with no path set.
-+ */
-+static void
-+test_keyfile_no_path (Fixture *fixture,
-+ gconstpointer user_data)
-+{
-+ const KeyfileTestData *test_data = user_data;
-+ GSettingsBackend *kf_backend;
-+ GSettings *settings;
-+ GKeyFile *keyfile;
-+ gboolean writable;
-+ gchar *key = NULL;
-+ GError *error = NULL;
-+ gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+ kf_backend = g_keyfile_settings_backend_new (store_path, test_data->root_path, test_data->root_group);
-+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, test_data->path);
-+ g_object_unref (kf_backend);
-+
-+ g_settings_reset (settings, "test-boolean");
-+ g_assert_true (g_settings_get_boolean (settings, "test-boolean"));
-+
-+ writable = g_settings_is_writable (settings, "test-boolean");
-+ g_assert_true (writable);
-+ g_settings_set (settings, "test-boolean", "b", FALSE);
-+
-+ g_assert_false (g_settings_get_boolean (settings, "test-boolean"));
-+
-+ g_settings_delay (settings);
-+ g_settings_set (settings, "test-boolean", "b", TRUE);
-+ g_settings_apply (settings);
-+
-+ keyfile = g_key_file_new ();
-+ g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+ g_assert_true (g_key_file_get_boolean (keyfile, test_data->keyfile_group, "test-boolean", NULL));
-+
-+ g_key_file_free (keyfile);
-+
-+ g_settings_reset (settings, "test-boolean");
-+ g_settings_apply (settings);
-+ keyfile = g_key_file_new ();
-+ g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+ g_assert_false (g_key_file_get_string (keyfile, test_data->keyfile_group, "test-boolean", &error));
-+ g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND);
-+ g_clear_error (&error);
-+
-+ /* Check that empty keys/groups are not allowed. */
-+ g_assert_false (g_settings_is_writable (settings, ""));
-+ g_assert_false (g_settings_is_writable (settings, "/"));
-+
-+ /* Keys which ghost the root group name are not allowed. This can only be
-+ * tested when the path is `/` as otherwise it acts as a prefix and prevents
-+ * any ghosting. */
-+ if (g_str_equal (test_data->path, "/"))
-+ {
-+ key = g_strdup_printf ("%s/%s", test_data->root_group, "");
-+ g_assert_false (g_settings_is_writable (settings, key));
-+ g_free (key);
-+
-+ key = g_strdup_printf ("%s/%s", test_data->root_group, "/");
-+ g_assert_false (g_settings_is_writable (settings, key));
-+ g_free (key);
-+
-+ key = g_strdup_printf ("%s/%s", test_data->root_group, "test-boolean");
-+ g_assert_false (g_settings_is_writable (settings, key));
-+ g_free (key);
-+ }
-+
-+ g_key_file_free (keyfile);
-+ g_object_unref (settings);
-+
-+ /* Clean up the temporary directory. */
-+ g_assert_cmpint (g_chmod (keyfile_path, 0777) == 0 ? 0 : errno, ==, 0);
-+ g_assert_cmpint (g_remove (store_path) == 0 ? 0 : errno, ==, 0);
-+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+ g_free (store_path);
-+ g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys outside its root path.
-+ */
-+static void
-+test_keyfile_outside_root_path (Fixture *fixture,
-+ gconstpointer user_data)
-+{
-+ GSettingsBackend *kf_backend;
-+ GSettings *settings;
-+ gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+ kf_backend = g_keyfile_settings_backend_new (store_path, "/tests/basic-types/", "root");
-+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/tests/");
-+ g_object_unref (kf_backend);
-+
-+ g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+
-+ g_object_unref (settings);
-+
-+ /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+ * don’t error on failure. */
-+ g_remove (store_path);
-+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+ g_free (store_path);
-+ g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys in the root if no root group is set.
-+ */
-+static void
-+test_keyfile_no_root_group (Fixture *fixture,
-+ gconstpointer user_data)
-+{
-+ GSettingsBackend *kf_backend;
-+ GSettings *settings;
-+ gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+ kf_backend = g_keyfile_settings_backend_new (store_path, "/", NULL);
-+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/");
-+ g_object_unref (kf_backend);
-+
-+ g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+ g_assert_true (g_settings_is_writable (settings, "child/test-boolean"));
-+
-+ g_object_unref (settings);
-+
-+ /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+ * don’t error on failure. */
-+ g_remove (store_path);
-+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+ g_free (store_path);
-+ g_free (keyfile_path);
-+}
-+
- /* Test that getting child schemas works
- */
- static void
-@@ -2844,6 +3000,14 @@ main (int argc, char *argv[])
- gchar *override_text;
- gchar *enums;
- gint result;
-+ const KeyfileTestData keyfile_test_data_explicit_path = { "/tests/", "root", "tests", "/" };
-+ const KeyfileTestData keyfile_test_data_empty_path = { "/", "root", "root", "/" };
-+ const KeyfileTestData keyfile_test_data_long_path = {
-+ "/tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch/",
-+ "root",
-+ "tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch",
-+ "/"
-+ };
-
- /* Meson build sets this */
- #ifdef TEST_LOCALE_PATH
-@@ -2967,6 +3131,11 @@ main (int argc, char *argv[])
- }
-
- g_test_add ("/gsettings/keyfile", Fixture, NULL, setup, test_keyfile, teardown);
-+ g_test_add ("/gsettings/keyfile/explicit-path", Fixture, &keyfile_test_data_explicit_path, setup, test_keyfile_no_path, teardown);
-+ g_test_add ("/gsettings/keyfile/empty-path", Fixture, &keyfile_test_data_empty_path, setup, test_keyfile_no_path, teardown);
-+ g_test_add ("/gsettings/keyfile/long-path", Fixture, &keyfile_test_data_long_path, setup, test_keyfile_no_path, teardown);
-+ g_test_add ("/gsettings/keyfile/outside-root-path", Fixture, NULL, setup, test_keyfile_outside_root_path, teardown);
-+ g_test_add ("/gsettings/keyfile/no-root-group", Fixture, NULL, setup, test_keyfile_no_root_group, teardown);
- g_test_add_func ("/gsettings/child-schema", test_child_schema);
- g_test_add_func ("/gsettings/strinfo", test_strinfo);
- g_test_add_func ("/gsettings/enums", test_enums);
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-28153.patch b/gnu/packages/patches/glib-CVE-2021-28153.patch
deleted file mode 100644
index 54443186d9..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-28153.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-Backport of:
-
-From 317b3b587058a05dca95d56dac26568c5b098d33 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 24 Feb 2021 17:35:40 +0000
-Subject: [PATCH] glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION
- with symlinks
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The `G_FILE_CREATE_REPLACE_DESTINATION` flag is equivalent to unlinking
-the destination file and re-creating it from scratch. That did
-previously work, but in the process the code would call `open(O_CREAT)`
-on the file. If the file was a dangling symlink, this would create the
-destination file (empty). That’s not an intended side-effect, and has
-security implications if the symlink is controlled by a lower-privileged
-process.
-
-Fix that by not opening the destination file if it’s a symlink, and
-adjusting the rest of the code to cope with
- - the fact that `fd == -1` is not an error iff `is_symlink` is true,
- - and that `original_stat` will contain the `lstat()` results for the
- symlink now, rather than the `stat()` results for its target (again,
- iff `is_symlink` is true).
-
-This means that the target of the dangling symlink is no longer created,
-which was the bug. The symlink itself continues to be replaced (as
-before) with the new file — this is the intended behaviour of
-`g_file_replace()`.
-
-The behaviour for non-symlink cases, or cases where the symlink was not
-dangling, should be unchanged.
-
-Includes a unit test.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-
-Fixes: #2325
----
- gio/glocalfileoutputstream.c | 70 ++++++++++++++++-------
- gio/tests/file.c | 108 +++++++++++++++++++++++++++++++++++
- 2 files changed, 158 insertions(+), 20 deletions(-)
-
-diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
-index a3dd62172..553fcbbae 100644
---- a/gio/glocalfileoutputstream.c
-+++ b/gio/glocalfileoutputstream.c
-@@ -874,16 +874,22 @@ handle_overwrite_open (const char *filename,
- /* Could be a symlink, or it could be a regular ELOOP error,
- * but then the next open will fail too. */
- is_symlink = TRUE;
-- fd = g_open (filename, open_flags, mode);
-+ if (!(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+ fd = g_open (filename, open_flags, mode);
- }
--#else
-- fd = g_open (filename, open_flags, mode);
-- errsv = errno;
-+#else /* if !O_NOFOLLOW */
- /* This is racy, but we do it as soon as possible to minimize the race */
- is_symlink = g_file_test (filename, G_FILE_TEST_IS_SYMLINK);
-+
-+ if (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+ {
-+ fd = g_open (filename, open_flags, mode);
-+ errsv = errno;
-+ }
- #endif
-
-- if (fd == -1)
-+ if (fd == -1 &&
-+ (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION)))
- {
- char *display_name = g_filename_display_name (filename);
- g_set_error (error, G_IO_ERROR,
-@@ -893,13 +899,25 @@ handle_overwrite_open (const char *filename,
- g_free (display_name);
- return -1;
- }
--
-+
-+ if (!is_symlink)
-+ {
- #ifdef G_OS_WIN32
-- res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
-+ res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
- #else
-- res = fstat (fd, &original_stat);
-+ res = fstat (fd, &original_stat);
- #endif
-- errsv = errno;
-+ errsv = errno;
-+ }
-+ else
-+ {
-+#ifdef G_OS_WIN32
-+ res = GLIB_PRIVATE_CALL (g_win32_lstat_utf8) (filename, &original_stat);
-+#else
-+ res = g_lstat (filename, &original_stat);
-+#endif
-+ errsv = errno;
-+ }
-
- if (res != 0)
- {
-@@ -916,16 +934,27 @@ handle_overwrite_open (const char *filename,
- if (!S_ISREG (original_stat.st_mode))
- {
- if (S_ISDIR (original_stat.st_mode))
-- g_set_error_literal (error,
-- G_IO_ERROR,
-- G_IO_ERROR_IS_DIRECTORY,
-- _("Target file is a directory"));
-- else
-- g_set_error_literal (error,
-- G_IO_ERROR,
-- G_IO_ERROR_NOT_REGULAR_FILE,
-- _("Target file is not a regular file"));
-- goto err_out;
-+ {
-+ g_set_error_literal (error,
-+ G_IO_ERROR,
-+ G_IO_ERROR_IS_DIRECTORY,
-+ _("Target file is a directory"));
-+ goto err_out;
-+ }
-+ else if (!is_symlink ||
-+#ifdef S_ISLNK
-+ !S_ISLNK (original_stat.st_mode)
-+#else
-+ FALSE
-+#endif
-+ )
-+ {
-+ g_set_error_literal (error,
-+ G_IO_ERROR,
-+ G_IO_ERROR_NOT_REGULAR_FILE,
-+ _("Target file is not a regular file"));
-+ goto err_out;
-+ }
- }
-
- if (etag != NULL)
-@@ -1006,7 +1035,8 @@ handle_overwrite_open (const char *filename,
- }
- }
-
-- g_close (fd, NULL);
-+ if (fd >= 0)
-+ g_close (fd, NULL);
- *temp_filename = tmp_filename;
- return tmpfd;
- }
-diff --git a/gio/tests/file.c b/gio/tests/file.c
-index efb2eaadd..bc55f3af4 100644
---- a/gio/tests/file.c
-+++ b/gio/tests/file.c
-@@ -804,6 +804,113 @@ test_replace_cancel (void)
- g_object_unref (tmpdir);
- }
-
-+static void
-+test_replace_symlink (void)
-+{
-+#ifdef G_OS_UNIX
-+ gchar *tmpdir_path = NULL;
-+ GFile *tmpdir = NULL, *source_file = NULL, *target_file = NULL;
-+ GFileOutputStream *stream = NULL;
-+ const gchar *new_contents = "this is a test message which should be written to source and not target";
-+ gsize n_written;
-+ GFileEnumerator *enumerator = NULL;
-+ GFileInfo *info = NULL;
-+ gchar *contents = NULL;
-+ gsize length = 0;
-+ GError *local_error = NULL;
-+
-+ g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2325");
-+ g_test_summary ("Test that G_FILE_CREATE_REPLACE_DESTINATION doesn’t follow symlinks");
-+
-+ /* Create a fresh, empty working directory. */
-+ tmpdir_path = g_dir_make_tmp ("g_file_replace_symlink_XXXXXX", &local_error);
-+ g_assert_no_error (local_error);
-+ tmpdir = g_file_new_for_path (tmpdir_path);
-+
-+ g_test_message ("Using temporary directory %s", tmpdir_path);
-+ g_free (tmpdir_path);
-+
-+ /* Create symlink `source` which points to `target`. */
-+ source_file = g_file_get_child (tmpdir, "source");
-+ target_file = g_file_get_child (tmpdir, "target");
-+ g_file_make_symbolic_link (source_file, "target", NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ /* Ensure that `target` doesn’t exist */
-+ g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+ /* Replace the `source` symlink with a regular file using
-+ * %G_FILE_CREATE_REPLACE_DESTINATION, which should replace it *without*
-+ * following the symlink */
-+ stream = g_file_replace (source_file, NULL, FALSE /* no backup */,
-+ G_FILE_CREATE_REPLACE_DESTINATION, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ g_output_stream_write_all (G_OUTPUT_STREAM (stream), new_contents, strlen (new_contents),
-+ &n_written, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+ g_assert_cmpint (n_written, ==, strlen (new_contents));
-+
-+ g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ g_clear_object (&stream);
-+
-+ /* At this point, there should still only be one file: `source`. It should
-+ * now be a regular file. `target` should not exist. */
-+ enumerator = g_file_enumerate_children (tmpdir,
-+ G_FILE_ATTRIBUTE_STANDARD_NAME ","
-+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
-+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+ g_assert_nonnull (info);
-+
-+ g_assert_cmpstr (g_file_info_get_name (info), ==, "source");
-+ g_assert_cmpint (g_file_info_get_file_type (info), ==, G_FILE_TYPE_REGULAR);
-+
-+ g_clear_object (&info);
-+
-+ info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+ g_assert_null (info);
-+
-+ g_file_enumerator_close (enumerator, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+ g_clear_object (&enumerator);
-+
-+ /* Double-check that `target` doesn’t exist */
-+ g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+ /* Check the content of `source`. */
-+ g_file_load_contents (source_file,
-+ NULL,
-+ &contents,
-+ &length,
-+ NULL,
-+ &local_error);
-+ g_assert_no_error (local_error);
-+ g_assert_cmpstr (contents, ==, new_contents);
-+ g_assert_cmpuint (length, ==, strlen (new_contents));
-+ g_free (contents);
-+
-+ /* Tidy up. */
-+ g_file_delete (source_file, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ g_file_delete (tmpdir, NULL, &local_error);
-+ g_assert_no_error (local_error);
-+
-+ g_clear_object (&target_file);
-+ g_clear_object (&source_file);
-+ g_clear_object (&tmpdir);
-+#else /* if !G_OS_UNIX */
-+ g_test_skip ("Symlink replacement tests can only be run on Unix")
-+#endif
-+}
-+
- static void
- on_file_deleted (GObject *object,
- GAsyncResult *result,
-@@ -1754,6 +1861,7 @@ main (int argc, char *argv[])
- g_test_add_data_func ("/file/async-create-delete/4096", GINT_TO_POINTER (4096), test_create_delete);
- g_test_add_func ("/file/replace-load", test_replace_load);
- g_test_add_func ("/file/replace-cancel", test_replace_cancel);
-+ g_test_add_func ("/file/replace-symlink", test_replace_symlink);
- g_test_add_func ("/file/async-delete", test_async_delete);
- #ifdef G_OS_UNIX
- g_test_add_func ("/file/copy-preserve-mode", test_copy_preserve_mode);
---
-2.30.1
-
diff --git a/gnu/packages/patches/glib-skip-failing-test.patch b/gnu/packages/patches/glib-skip-failing-test.patch
new file mode 100644
index 0000000000..c7706aaa74
--- /dev/null
+++ b/gnu/packages/patches/glib-skip-failing-test.patch
@@ -0,0 +1,27 @@
+This test timed out on powerpc-linux even after extending the
+test_timeout_slow to 1800 seconds. Previously we tried to work around
+this test by extending test_timeout_slow by 1.5 its previous value.
+
+---
+ gio/tests/meson.build | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/gio/tests/meson.build b/gio/tests/meson.build
+index a926ae0..4fdbe7a 100644
+--- a/gio/tests/meson.build
++++ b/gio/tests/meson.build
+@@ -317,10 +317,6 @@ if host_machine.system() != 'windows'
+ 'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
+ 'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
+ },
+- 'gdbus-threading' : {
+- 'extra_sources' : extra_sources,
+- 'suite' : ['slow'],
+- },
+ 'gmenumodel' : {
+ 'extra_sources' : extra_sources,
+ 'suite' : ['slow'],
+
+--
+2.31.1
+
diff --git a/gnu/packages/patches/glib-tests-timer.patch b/gnu/packages/patches/glib-tests-timer.patch
deleted file mode 100644
index e37425c0c8..0000000000
--- a/gnu/packages/patches/glib-tests-timer.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-* On i686 floating-point roundoff errors could sometimes cause this check to
- fail depending on the elapsed microseconds. Improve rounding by adding a
- fractional bit.
-
---- glib-2.40.0/glib/tests/timer.c 2014-03-05 08:05:42.000000000 -0600
-+++ glib-2.40.0/glib/tests/timer.c 2014-07-10 16:33:12.746862822 -0500
-@@ -35,7 +35,7 @@
- elapsed = g_timer_elapsed (timer, &micros);
-
- g_assert_cmpfloat (elapsed, <, 1.0);
-- g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
-+ g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6 + 0.5)) % 1000000);
-
- g_timer_destroy (timer);
- }
diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch
index 39eb47ef26..fcaf17132d 100644
--- a/gnu/packages/patches/glibc-bootstrap-system.patch
+++ b/gnu/packages/patches/glibc-bootstrap-system.patch
@@ -3,17 +3,10 @@ and popen(3) need to be tweaked to use the right shell. For the bootstrap
glibc, we just use whatever `sh' can be found in $PATH. The final glibc
instead uses the hard-coded absolute file name of `bash'.
---- a/sysdeps/posix/system.c
-+++ b/sysdeps/posix/system.c
-@@ -140,7 +140,7 @@ do_system (const char *line)
- __posix_spawnattr_setflags (&spawn_attr,
- POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
-
-- status = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
-+ status = posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
- (char *const[]){ (char*) SHELL_NAME,
- (char*) "-c",
- (char *) line, NULL },
+In addition, status should be initialized to 0 and not -1.
+
+diff --git a/libio/iopopen.c b/libio/iopopen.c
+index ebc381ed7c..e0d3ed1bc3 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -85,7 +85,7 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
@@ -25,4 +18,25 @@ instead uses the hard-coded absolute file name of `bash'.
(char *const[]){ (char*) "sh", (char*) "-c",
(char *) command, NULL }, __environ) != 0)
return false;
-
+diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
+index a03f478fc7..94da6facf3 100644
+--- a/sysdeps/posix/system.c
++++ b/sysdeps/posix/system.c
+@@ -101,7 +101,7 @@ cancel_handler (void *arg)
+ static int
+ do_system (const char *line)
+ {
+- int status = -1;
++ int status = 0;
+ int ret;
+ pid_t pid;
+ struct sigaction sa;
+@@ -145,7 +145,7 @@ do_system (const char *line)
+ __posix_spawnattr_setflags (&spawn_attr,
+ POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
+
+- ret = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
++ ret = posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
+ (char *const[]){ (char *) SHELL_NAME,
+ (char *) "-c",
+ (char *) line, NULL },
diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch
new file mode 100644
index 0000000000..68c3a94846
--- /dev/null
+++ b/gnu/packages/patches/glibc-dl-cache.patch
@@ -0,0 +1,140 @@
+Read the shared library cache relative to $ORIGIN instead of reading
+from /etc/ld.so.cache. Also arrange so that this cache takes
+precedence over RUNPATH.
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 93d185e788..e0760a1f40 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -171,6 +171,51 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+ return *p1 - *p2;
+ }
+
++/* Special value representing the lack of an ld.so cache. */
++static const char ld_so_cache_lacking[] = "/ld.so cache is lacking";
++
++/* Return the per-application ld.so cache, relative to $ORIGIN, or NULL if
++ that fails for some reason. Do not return the system-wide LD_SO_CACHE
++ since on a foreign distro it would contain invalid information. */
++static const char *
++ld_so_cache (void)
++{
++ static const char *loader_cache;
++
++ if (loader_cache == NULL)
++ {
++ static const char store[] = @STORE_DIRECTORY@;
++ const char *origin = _dl_get_origin ();
++
++ /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin". */
++ if (strncmp (store, origin, strlen (store)) == 0
++ && origin[sizeof store - 1] == '/')
++ {
++ char *store_item_end = strchr (origin + sizeof store, '/');
++
++ if (store_item_end != NULL)
++ {
++ static const char suffix[] = "/etc/ld.so.cache";
++ size_t store_item_len = store_item_end - origin;
++
++ /* Note: We can't use 'malloc' because it can be interposed.
++ Likewise, 'strncpy' is not available. */
++ char *cache = alloca (strlen (origin) + sizeof suffix);
++
++ strcpy (cache, origin);
++ strcpy (cache + store_item_len, suffix);
++
++ loader_cache = __strdup (cache) ?: ld_so_cache_lacking;
++ }
++ else
++ loader_cache = ld_so_cache_lacking;
++ }
++ else
++ loader_cache = ld_so_cache_lacking;
++ }
++
++ return loader_cache;
++}
+
+ /* Look up NAME in ld.so.cache and return the file name stored there, or null
+ if none is found. The cache is loaded if it was not already. If loading
+@@ -190,12 +235,15 @@ _dl_load_cache_lookup (const char *name)
+
+ /* Print a message if the loading of libs is traced. */
+ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
++ _dl_debug_printf (" search cache=%s\n", ld_so_cache ());
++
++ if (__glibc_unlikely (ld_so_cache () == ld_so_cache_lacking))
++ return NULL;
+
+ if (cache == NULL)
+ {
+ /* Read the contents of the file. */
+- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
++ void *file = _dl_sysdep_read_whole_file (ld_so_cache (), &cachesize,
+ PROT_READ);
+
+ /* We can handle three different cache file formats here:
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f3201e7c14..a69aec3428 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2152,28 +2152,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
+ LA_SER_LIBPATH, &found_other_class);
+
+- /* Look at the RUNPATH information for this binary. */
+- if (fd == -1 && loader != NULL
+- && cache_rpath (loader, &loader->l_runpath_dirs,
+- DT_RUNPATH, "RUNPATH"))
+- fd = open_path (name, namelen, mode,
+- &loader->l_runpath_dirs, &realname, &fb, loader,
+- LA_SER_RUNPATH, &found_other_class);
+-
+- if (fd == -1)
+- {
+- realname = _dl_sysdep_open_object (name, namelen, &fd);
+- if (realname != NULL)
+- {
+- fd = open_verify (realname, fd,
+- &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
+- LA_SER_CONFIG, mode, &found_other_class,
+- false);
+- if (fd == -1)
+- free (realname);
+- }
+- }
+-
+ #ifdef USE_LDCONFIG
+ if (fd == -1
+ && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2232,6 +2210,28 @@ _dl_map_object (struct link_map *loader, const char *name,
+ }
+ #endif
+
++ /* Look at the RUNPATH information for this binary. */
++ if (fd == -1 && loader != NULL
++ && cache_rpath (loader, &loader->l_runpath_dirs,
++ DT_RUNPATH, "RUNPATH"))
++ fd = open_path (name, namelen, mode,
++ &loader->l_runpath_dirs, &realname, &fb, loader,
++ LA_SER_RUNPATH, &found_other_class);
++
++ if (fd == -1)
++ {
++ realname = _dl_sysdep_open_object (name, namelen, &fd);
++ if (realname != NULL)
++ {
++ fd = open_verify (realname, fd,
++ &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
++ LA_SER_CONFIG, mode, &found_other_class,
++ false);
++ if (fd == -1)
++ free (realname);
++ }
++ }
++
+ /* Finally, try the default path. */
+ if (fd == -1
+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
index 1c3fe427f9..e31f99a1ce 100644
--- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
+++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
@@ -24,18 +24,17 @@ Subject: [PATCH 2/2] Use realtime clock for the monotonic clock.
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
-index ac3547df3c..af8681ba4e 100644
+index 6862fc8c..be1449bf 100644
--- a/sysdeps/mach/clock_gettime.c
+++ b/sysdeps/mach/clock_gettime.c
-@@ -25,7 +25,7 @@
- int
- __clock_gettime (clockid_t clock_id, struct timespec *ts)
- {
-- if (clock_id != CLOCK_REALTIME)
-+ if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
- {
- errno = EINVAL;
- return -1;
+@@ -32,6 +32,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
+ switch (clock_id) {
+
+ case CLOCK_REALTIME:
++ case CLOCK_MONOTONIC:
+ {
+ /* __host_get_time can only fail if passed an invalid host_t.
+ __mach_host_self could theoretically fail (producing an
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index 0050151332..27b3a28ab7 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
diff --git a/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch b/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch
deleted file mode 100644
index 36ea55e188..0000000000
--- a/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch
+++ /dev/null
@@ -1,637 +0,0 @@
-This patch is needed to build e2fsprogs, util-linux.
-
-Taken from https://salsa.debian.org/glibc-team/glibc/-/blob/glibc-2.31/debian/patches/hurd-i386/tg-hurdsig-SA_SIGINFO.diff
-
-From: Jeremie Koenig <jk@jk.fr.eu.org>
-Subject: [PATCH] implement SA_SIGINFO signal handlers.
-
- 52baaca Hurd signals: Copy bits/sigaction.h
- 4232c66 Hurd signals: SA_SIGINFO support
- 1831cfe Hurd signals: Use POSIX sigcodes
-
----
- hurd/hurd/signal.h | 5 +
- hurd/hurdfault.c | 2
- hurd/hurdinit.c | 2
- hurd/hurdsig.c | 6 -
- sysdeps/mach/hurd/bits/sigaction.h | 86 +++++++++++++++++++++
- sysdeps/mach/hurd/i386/bits/sigcontext.h | 4
- sysdeps/mach/hurd/i386/exc2signal.c | 123 +++++++++++++++++++-----------
- sysdeps/mach/hurd/i386/trampoline.c | 125 ++++++++++++++++++++++++++++---
- sysdeps/mach/hurd/kill.c | 2
- sysdeps/mach/hurd/setitimer.c | 2
- 10 files changed, 293 insertions(+), 64 deletions(-)
-
-Index: glibc-2.31/hurd/hurd/signal.h
-===================================================================
---- glibc-2.31.orig/hurd/hurd/signal.h
-+++ glibc-2.31/hurd/hurd/signal.h
-@@ -290,6 +290,11 @@ extern int _hurd_raise_signal (struct hu
- extern void _hurd_exception2signal (struct hurd_signal_detail *detail,
- int *signo);
-
-+/* Translate a Mach exception into a signal with a legacy sigcode. */
-+
-+extern void _hurd_exception2signal_legacy (struct hurd_signal_detail *detail,
-+ int *signo);
-+
-
- /* Make the thread described by SS take the signal described by SIGNO and
- DETAIL. If the process is traced, this will in fact stop with a SIGNO
-Index: glibc-2.31/hurd/hurdfault.c
-===================================================================
---- glibc-2.31.orig/hurd/hurdfault.c
-+++ glibc-2.31/hurd/hurdfault.c
-@@ -70,7 +70,7 @@ _hurdsig_fault_catch_exception_raise (ma
- codes into a signal number and subcode. */
- _hurd_exception2signal (&d, &signo);
-
-- return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preemptor, signo, d.code)
-+ return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preemptor, signo, d.exc_subcode)
- ? 0 : EGREGIOUS;
- }
-
-Index: glibc-2.31/hurd/hurdinit.c
-===================================================================
---- glibc-2.31.orig/hurd/hurdinit.c
-+++ glibc-2.31/hurd/hurdinit.c
-@@ -177,7 +177,7 @@ _hurd_new_proc_init (char **argv,
- /* This process is "traced", meaning it should stop on signals or exec.
- We are all set up now to handle signals. Stop ourselves, to inform
- our parent (presumably a debugger) that the exec has completed. */
-- __msg_sig_post (_hurd_msgport, SIGTRAP, 0, __mach_task_self ());
-+ __msg_sig_post (_hurd_msgport, SIGTRAP, TRAP_TRACE, __mach_task_self ());
- }
-
- #include <shlib-compat.h>
-Index: glibc-2.31/hurd/hurdsig.c
-===================================================================
---- glibc-2.31.orig/hurd/hurdsig.c
-+++ glibc-2.31/hurd/hurdsig.c
-@@ -730,7 +730,7 @@ post_signal (struct hurd_sigstate *ss,
- { /* PE cannot be null. */
- do
- {
-- if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
-+ if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->exc_subcode))
- {
- if (pe->preemptor)
- {
-@@ -1374,7 +1374,7 @@ _S_msg_sig_post (mach_port_t me,
- if (err = signal_allowed (signo, refport))
- return err;
-
-- d.code = sigcode;
-+ d.code = d.exc_subcode = sigcode;
- d.exc = 0;
-
- /* Post the signal to a global receiver thread (or mark it pending in
-@@ -1403,7 +1403,7 @@ _S_msg_sig_post_untraced (mach_port_t me
- if (err = signal_allowed (signo, refport))
- return err;
-
-- d.code = sigcode;
-+ d.code = d.exc_subcode = sigcode;
- d.exc = 0;
-
- /* Post the signal to the designated signal-receiving thread. This will
-Index: glibc-2.31/sysdeps/mach/hurd/bits/sigaction.h
-===================================================================
---- /dev/null
-+++ glibc-2.31/sysdeps/mach/hurd/bits/sigaction.h
-@@ -0,0 +1,86 @@
-+/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _BITS_SIGACTION_H
-+#define _BITS_SIGACTION_H 1
-+
-+#ifndef _SIGNAL_H
-+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
-+#endif
-+
-+/* These definitions match those used by the 4.4 BSD kernel.
-+ If the operating system has a `sigaction' system call that correctly
-+ implements the POSIX.1 behavior, there should be a system-dependent
-+ version of this file that defines `struct sigaction' and the `SA_*'
-+ constants appropriately. */
-+
-+/* Structure describing the action to be taken when a signal arrives. */
-+struct sigaction
-+ {
-+ /* Signal handler. */
-+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
-+ union
-+ {
-+ /* Used if SA_SIGINFO is not set. */
-+ __sighandler_t sa_handler;
-+ /* Used if SA_SIGINFO is set. */
-+ void (*sa_sigaction) (int, siginfo_t *, void *);
-+ }
-+ __sigaction_handler;
-+# define sa_handler __sigaction_handler.sa_handler
-+# define sa_sigaction __sigaction_handler.sa_sigaction
-+#else
-+ __sighandler_t sa_handler;
-+#endif
-+
-+ /* Additional set of signals to be blocked. */
-+ __sigset_t sa_mask;
-+
-+ /* Special flags. */
-+ int sa_flags;
-+ };
-+
-+/* Bits in `sa_flags'. */
-+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
-+# define SA_ONSTACK 0x0001 /* Take signal on signal stack. */
-+#endif
-+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-+# define SA_RESTART 0x0002 /* Restart syscall on signal return. */
-+# define SA_NODEFER 0x0010 /* Don't automatically block the signal when
-+ its handler is being executed. */
-+# define SA_RESETHAND 0x0004 /* Reset to SIG_DFL on entry to handler. */
-+#endif
-+#define SA_NOCLDSTOP 0x0008 /* Don't send SIGCHLD when children stop. */
-+#define SA_SIGINFO 0x0040 /* Signal handler with SA_SIGINFO args */
-+
-+#ifdef __USE_MISC
-+# define SA_INTERRUPT 0 /* Historical no-op ("not SA_RESTART"). */
-+
-+/* Some aliases for the SA_ constants. */
-+# define SA_NOMASK SA_NODEFER
-+# define SA_ONESHOT SA_RESETHAND
-+# define SA_STACK SA_ONSTACK
-+#endif
-+
-+
-+/* Values for the HOW argument to `sigprocmask'. */
-+#define SIG_BLOCK 1 /* Block signals. */
-+#define SIG_UNBLOCK 2 /* Unblock signals. */
-+#define SIG_SETMASK 3 /* Set the set of blocked signals. */
-+
-+#endif
-Index: glibc-2.31/sysdeps/mach/hurd/i386/bits/sigcontext.h
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/i386/bits/sigcontext.h
-+++ glibc-2.31/sysdeps/mach/hurd/i386/bits/sigcontext.h
-@@ -97,6 +97,10 @@ struct sigcontext
- #define sc_ps sc_efl
-
-
-+/* The deprecated sigcode values below are passed as an extra, non-portable
-+ argument to regular signal handlers. You should use SA_SIGINFO handlers
-+ instead, which use the standard POSIX signal codes. */
-+
- /* Codes for SIGFPE. */
- #define FPE_INTOVF_TRAP 0x1 /* integer overflow */
- #define FPE_INTDIV_FAULT 0x2 /* integer divide by zero */
-Index: glibc-2.31/sysdeps/mach/hurd/i386/exc2signal.c
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/i386/exc2signal.c
-+++ glibc-2.31/sysdeps/mach/hurd/i386/exc2signal.c
-@@ -23,8 +23,8 @@
- /* Translate the Mach exception codes, as received in an `exception_raise' RPC,
- into a signal number and signal subcode. */
-
--void
--_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
-+static void
-+exception2signal (struct hurd_signal_detail *detail, int *signo, int posix)
- {
- detail->error = 0;
-
-@@ -36,44 +36,62 @@ _hurd_exception2signal (struct hurd_sign
- break;
-
- case EXC_BAD_ACCESS:
-- if (detail->exc_code == KERN_INVALID_ADDRESS
-- || detail->exc_code == KERN_PROTECTION_FAILURE
-- || detail->exc_code == KERN_WRITE_PROTECTION_FAILURE)
-- *signo = SIGSEGV;
-- else
-- *signo = SIGBUS;
-- detail->code = detail->exc_subcode;
-+ switch (detail->exc_code)
-+ {
-+ case KERN_INVALID_ADDRESS:
-+ case KERN_MEMORY_FAILURE:
-+ *signo = SIGSEGV;
-+ detail->code = posix ? SEGV_MAPERR : detail->exc_subcode;
-+ break;
-+
-+ case KERN_PROTECTION_FAILURE:
-+ case KERN_WRITE_PROTECTION_FAILURE:
-+ *signo = SIGSEGV;
-+ detail->code = posix ? SEGV_ACCERR : detail->exc_subcode;
-+ break;
-+
-+ default:
-+ *signo = SIGBUS;
-+ detail->code = posix ? BUS_ADRERR : detail->exc_subcode;
-+ break;
-+ }
- detail->error = detail->exc_code;
- break;
-
- case EXC_BAD_INSTRUCTION:
- *signo = SIGILL;
-- if (detail->exc_code == EXC_I386_INVOP)
-- detail->code = ILL_INVOPR_FAULT;
-- else if (detail->exc_code == EXC_I386_STKFLT)
-- detail->code = ILL_STACK_FAULT;
-- else
-- detail->code = 0;
-+ switch (detail->exc_code)
-+ {
-+ case EXC_I386_INVOP:
-+ detail->code = posix ? ILL_ILLOPC : ILL_INVOPR_FAULT;
-+ break;
-+
-+ case EXC_I386_STKFLT:
-+ detail->code = posix ? ILL_BADSTK : ILL_STACK_FAULT;
-+ break;
-+
-+ default:
-+ detail->code = 0;
-+ break;
-+ }
- break;
-
- case EXC_ARITHMETIC:
-+ *signo = SIGFPE;
- switch (detail->exc_code)
- {
- case EXC_I386_DIV: /* integer divide by zero */
-- *signo = SIGFPE;
-- detail->code = FPE_INTDIV_FAULT;
-+ detail->code = posix ? FPE_INTDIV : FPE_INTDIV_FAULT;
- break;
-
- case EXC_I386_INTO: /* integer overflow */
-- *signo = SIGFPE;
-- detail->code = FPE_INTOVF_TRAP;
-+ detail->code = posix ? FPE_INTOVF : FPE_INTOVF_TRAP;
- break;
-
- /* These aren't anywhere documented or used in Mach 3.0. */
- case EXC_I386_NOEXT:
- case EXC_I386_EXTOVR:
- default:
-- *signo = SIGFPE;
- detail->code = 0;
- break;
-
-@@ -82,51 +100,43 @@ _hurd_exception2signal (struct hurd_sign
- Give an error code corresponding to the first bit set. */
- if (detail->exc_subcode & FPS_IE)
- {
-- *signo = SIGILL;
-- detail->code = ILL_FPEOPR_FAULT;
-+ /* NB: We used to send SIGILL here but we can't distinguish
-+ POSIX vs. legacy with respect to what signal we send. */
-+ detail->code = posix ? FPE_FLTINV : 0 /*ILL_FPEOPR_FAULT*/;
- }
- else if (detail->exc_subcode & FPS_DE)
- {
-- *signo = SIGFPE;
-- detail->code = FPE_FLTDNR_FAULT;
-+ detail->code = posix ? FPE_FLTUND : FPE_FLTDNR_FAULT;
- }
- else if (detail->exc_subcode & FPS_ZE)
- {
-- *signo = SIGFPE;
-- detail->code = FPE_FLTDIV_FAULT;
-+ detail->code = posix ? FPE_FLTDIV : FPE_FLTDIV_FAULT;
- }
- else if (detail->exc_subcode & FPS_OE)
- {
-- *signo = SIGFPE;
-- detail->code = FPE_FLTOVF_FAULT;
-+ detail->code = posix ? FPE_FLTOVF : FPE_FLTOVF_FAULT;
- }
- else if (detail->exc_subcode & FPS_UE)
- {
-- *signo = SIGFPE;
-- detail->code = FPE_FLTUND_FAULT;
-+ detail->code = posix ? FPE_FLTUND : FPE_FLTUND_FAULT;
- }
- else if (detail->exc_subcode & FPS_PE)
- {
-- *signo = SIGFPE;
-- detail->code = FPE_FLTINX_FAULT;
-+ detail->code = posix ? FPE_FLTRES : FPE_FLTINX_FAULT;
- }
- else
- {
-- *signo = SIGFPE;
- detail->code = 0;
- }
- break;
-
- /* These two can only be arithmetic exceptions if we
-- are in V86 mode, which sounds like emulation to me.
-- (See Mach 3.0 i386/trap.c.) */
-+ are in V86 mode. (See Mach 3.0 i386/trap.c.) */
- case EXC_I386_EMERR:
-- *signo = SIGFPE;
-- detail->code = FPE_EMERR_FAULT;
-+ detail->code = posix ? 0 : FPE_EMERR_FAULT;
- break;
- case EXC_I386_BOUND:
-- *signo = SIGFPE;
-- detail->code = FPE_EMBND_FAULT;
-+ detail->code = posix ? FPE_FLTSUB : FPE_EMBND_FAULT;
- break;
- }
- break;
-@@ -143,7 +153,7 @@ _hurd_exception2signal (struct hurd_sign
- if (detail->exc_code == EXC_I386_BOUND)
- {
- *signo = SIGFPE;
-- detail->code = FPE_SUBRNG_FAULT;
-+ detail->code = posix ? FPE_FLTSUB : FPE_SUBRNG_FAULT;
- }
- else
- {
-@@ -154,13 +164,34 @@ _hurd_exception2signal (struct hurd_sign
-
- case EXC_BREAKPOINT:
- *signo = SIGTRAP;
-- if (detail->exc_code == EXC_I386_SGL)
-- detail->code = DBG_SINGLE_TRAP;
-- else if (detail->exc_code == EXC_I386_BPT)
-- detail->code = DBG_BRKPNT_FAULT;
-- else
-- detail->code = 0;
-+ switch (detail->exc_code)
-+ {
-+ case EXC_I386_SGL:
-+ detail->code = posix ? TRAP_BRKPT : DBG_SINGLE_TRAP;
-+ break;
-+
-+ case EXC_I386_BPT:
-+ detail->code = posix ? TRAP_BRKPT : DBG_BRKPNT_FAULT;
-+ break;
-+
-+ default:
-+ detail->code = 0;
-+ break;
-+ }
- break;
- }
- }
- libc_hidden_def (_hurd_exception2signal)
-+
-+void
-+_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
-+{
-+ exception2signal (detail, signo, 1);
-+}
-+
-+void
-+_hurd_exception2signal_legacy (struct hurd_signal_detail *detail, int *signo)
-+{
-+ exception2signal (detail, signo, 0);
-+}
-+
-Index: glibc-2.31/sysdeps/mach/hurd/i386/trampoline.c
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/i386/trampoline.c
-+++ glibc-2.31/sysdeps/mach/hurd/i386/trampoline.c
-@@ -19,13 +19,66 @@
- #include <hurd/signal.h>
- #include <hurd/userlink.h>
- #include <thread_state.h>
-+#include <mach/exception.h>
- #include <mach/machine/eflags.h>
- #include <assert.h>
- #include <errno.h>
- #include "hurdfault.h"
- #include <intr-msg.h>
-+#include <sys/ucontext.h>
-
-
-+/* Fill in a siginfo_t structure for SA_SIGINFO-enabled handlers. */
-+static void fill_siginfo (siginfo_t *si, int signo,
-+ const struct hurd_signal_detail *detail,
-+ const struct machine_thread_all_state *state)
-+{
-+ si->si_signo = signo;
-+ si->si_errno = detail->error;
-+ si->si_code = detail->code;
-+
-+ /* XXX We would need a protocol change for sig_post to include
-+ * this information. */
-+ si->si_pid = -1;
-+ si->si_uid = -1;
-+
-+ /* Address of the faulting instruction or memory access. */
-+ if (detail->exc == EXC_BAD_ACCESS)
-+ si->si_addr = (void *) detail->exc_subcode;
-+ else
-+ si->si_addr = (void *) state->basic.eip;
-+
-+ /* XXX On SIGCHLD, this should be the exit status of the child
-+ * process. We would need a protocol change for the proc server
-+ * to send this information along with the signal. */
-+ si->si_status = 0;
-+
-+ si->si_band = 0; /* SIGPOLL is not supported yet. */
-+ si->si_value.sival_int = 0; /* sigqueue() is not supported yet. */
-+}
-+
-+/* Fill in a ucontext_t structure SA_SIGINFO-enabled handlers. */
-+static void fill_ucontext (ucontext_t *uc, const struct sigcontext *sc)
-+{
-+ uc->uc_flags = 0;
-+ uc->uc_link = NULL;
-+ uc->uc_sigmask = sc->sc_mask;
-+ uc->uc_stack.ss_sp = (__ptr_t) sc->sc_esp;
-+ uc->uc_stack.ss_size = 0;
-+ uc->uc_stack.ss_flags = 0;
-+
-+ /* Registers. */
-+ memcpy (&uc->uc_mcontext.gregs[REG_GS], &sc->sc_gs,
-+ (REG_TRAPNO - REG_GS) * sizeof (int));
-+ uc->uc_mcontext.gregs[REG_TRAPNO] = 0;
-+ uc->uc_mcontext.gregs[REG_ERR] = 0;
-+ memcpy (&uc->uc_mcontext.gregs[REG_EIP], &sc->sc_eip,
-+ (NGREG - REG_EIP) * sizeof (int));
-+
-+ /* XXX FPU state. */
-+ memset (&uc->uc_mcontext.fpregs, 0, sizeof (fpregset_t));
-+}
-+
- struct sigcontext *
- _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
- int signo, struct hurd_signal_detail *detail,
-@@ -43,15 +96,38 @@ _hurd_setup_sighandler (struct hurd_sigs
- struct
- {
- int signo;
-- long int sigcode;
-- struct sigcontext *scp; /* Points to ctx, below. */
-+ union
-+ {
-+ /* Extra arguments for traditional signal handlers */
-+ struct
-+ {
-+ long int sigcode;
-+ struct sigcontext *scp; /* Points to ctx, below. */
-+ } legacy;
-+
-+ /* Extra arguments for SA_SIGINFO handlers */
-+ struct
-+ {
-+ siginfo_t *siginfop; /* Points to siginfo, below. */
-+ ucontext_t *uctxp; /* Points to uctx, below. */
-+ } posix;
-+ };
- void *sigreturn_addr;
- void *sigreturn_returns_here;
- struct sigcontext *return_scp; /* Same; arg to sigreturn. */
-+
-+ /* NB: sigreturn assumes link is next to ctx. */
- struct sigcontext ctx;
- struct hurd_userlink link;
-+ ucontext_t ucontext;
-+ siginfo_t siginfo;
- } *stackframe;
-
-+ /* sigaction for preemptors */
-+ static const struct sigaction legacy_sigaction = {
-+ .sa_flags = SA_RESTART
-+ };
-+
- if (ss->context)
- {
- /* We have a previous sigcontext that sigreturn was about
-@@ -94,9 +170,13 @@ _hurd_setup_sighandler (struct hurd_sigs
- the SP on sigreturn. */
- state->basic.uesp = state->basic.ecx;
-
-- /* XXX what if handler != action->handler (for instance, if a signal
-- * preemptor took over) ? */
- action = & _hurd_sigstate_actions (ss) [signo];
-+ if ( (action->sa_flags & SA_SIGINFO)
-+ && handler != (__sighandler_t) action->sa_sigaction
-+ || !(action->sa_flags & SA_SIGINFO)
-+ && handler != action->sa_handler)
-+ /* A signal preemptor took over, use legacy semantic. */
-+ action = &legacy_sigaction;
-
- if ((action->sa_flags & SA_ONSTACK)
- && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK)))
-@@ -140,15 +220,9 @@ _hurd_setup_sighandler (struct hurd_sigs
- = &stackframe->link.thread.next;
- ss->active_resources = &stackframe->link;
-
-- /* Set up the arguments for the signal handler. */
-- stackframe->signo = signo;
-- stackframe->sigcode = detail->code;
-- stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx;
-- stackframe->sigreturn_addr = &__sigreturn;
-- stackframe->sigreturn_returns_here = firewall; /* Crash on return. */
--
- /* Set up the sigcontext from the current state of the thread. */
-
-+ scp = &stackframe->ctx;
- scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0;
-
- /* struct sigcontext is laid out so that starting at sc_gs mimics a
-@@ -162,6 +236,35 @@ _hurd_setup_sighandler (struct hurd_sigs
- &state->fpu, &scp->sc_i386_float_state,
- sizeof (state->fpu));
-
-+ /* Set up the arguments for the signal handler. */
-+ stackframe->signo = signo;
-+ if (action->sa_flags & SA_SIGINFO)
-+ {
-+ stackframe->posix.siginfop = &stackframe->siginfo;
-+ stackframe->posix.uctxp = &stackframe->ucontext;
-+ fill_siginfo (&stackframe->siginfo, signo, detail, state);
-+ fill_ucontext (&stackframe->ucontext, scp);
-+ }
-+ else
-+ {
-+ if (detail->exc)
-+ {
-+ int nsigno;
-+ _hurd_exception2signal_legacy (detail, &nsigno);
-+ assert (nsigno == signo);
-+ }
-+ else
-+ detail->code = 0;
-+
-+ stackframe->legacy.sigcode = detail->code;
-+ stackframe->legacy.scp = &stackframe->ctx;
-+ }
-+
-+ /* Set up the bottom of the stack. */
-+ stackframe->sigreturn_addr = &__sigreturn;
-+ stackframe->sigreturn_returns_here = firewall; /* Crash on return. */
-+ stackframe->return_scp = &stackframe->ctx;
-+
- _hurdsig_end_catch_fault ();
-
- if (! ok)
-Index: glibc-2.31/sysdeps/mach/hurd/kill.c
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/kill.c
-+++ glibc-2.31/sysdeps/mach/hurd/kill.c
-@@ -64,7 +64,7 @@ __kill (pid_t pid, int sig)
- {
- if (msgport != MACH_PORT_NULL)
- /* Send a signal message to his message port. */
-- return __msg_sig_post (msgport, sig, 0, refport);
-+ return __msg_sig_post (msgport, sig, SI_USER, refport);
-
- /* The process has no message port. Perhaps try direct
- frobnication of the task. */
-Index: glibc-2.31/sysdeps/mach/hurd/setitimer.c
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/setitimer.c
-+++ glibc-2.31/sysdeps/mach/hurd/setitimer.c
-@@ -105,7 +105,7 @@ timer_thread (void)
- __msg_sig_post_request (_hurd_msgport,
- _hurd_itimer_port,
- MACH_MSG_TYPE_MAKE_SEND_ONCE,
-- SIGALRM, 0, __mach_task_self ());
-+ SIGALRM, SI_TIMER, __mach_task_self ());
- break;
-
- case MACH_RCV_INTERRUPTED:
-Index: glibc-2.31/sysdeps/mach/hurd/i386/sigcontextinfo.h
-===================================================================
---- glibc-2.31.orig/sysdeps/mach/hurd/i386/sigcontextinfo.h
-+++ glibc-2.31/sysdeps/mach/hurd/i386/sigcontextinfo.h
-@@ -18,11 +18,10 @@
- #ifndef _SIGCONTEXTINFO_H
- #define _SIGCONTEXTINFO_H
-
--#define SIGCONTEXT struct sigcontext
- static inline uintptr_t
--sigcontext_get_pc (struct sigcontext ctx)
-+sigcontext_get_pc (struct ucontext_t *ctx)
- {
-- return ctx.sc_eip;
-+ return ctx->uc_mcontext.gregs[REG_EIP];
- }
-
- #endif
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20231.patch b/gnu/packages/patches/gnutls-CVE-2021-20231.patch
deleted file mode 100644
index 5186522eee..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20231.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 15beb4b193b2714d88107e7dffca781798684e7e Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:05 +0100
-Subject: [PATCH 1/2] key_share: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/key_share.c | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/lib/ext/key_share.c b/lib/ext/key_share.c
-index ab8abf8fe..a8c4bb5cf 100644
---- a/lib/ext/key_share.c
-+++ b/lib/ext/key_share.c
-@@ -664,14 +664,14 @@ key_share_send_params(gnutls_session_t session,
- {
- unsigned i;
- int ret;
-- unsigned char *lengthp;
-- unsigned int cur_length;
- unsigned int generated = 0;
- const gnutls_group_entry_st *group;
- const version_entry_st *ver;
-
- /* this extension is only being sent on client side */
- if (session->security_parameters.entity == GNUTLS_CLIENT) {
-+ unsigned int length_pos;
-+
- ver = _gnutls_version_max(session);
- if (unlikely(ver == NULL || ver->key_shares == 0))
- return 0;
-@@ -679,16 +679,13 @@ key_share_send_params(gnutls_session_t session,
- if (!have_creds_for_tls13(session))
- return 0;
-
-- /* write the total length later */
-- lengthp = &extdata->data[extdata->length];
-+ length_pos = extdata->length;
-
- ret =
- _gnutls_buffer_append_prefix(extdata, 16, 0);
- if (ret < 0)
- return gnutls_assert_val(ret);
-
-- cur_length = extdata->length;
--
- if (session->internals.hsk_flags & HSK_HRR_RECEIVED) { /* we know the group */
- group = get_group(session);
- if (unlikely(group == NULL))
-@@ -736,7 +733,8 @@ key_share_send_params(gnutls_session_t session,
- }
-
- /* copy actual length */
-- _gnutls_write_uint16(extdata->length - cur_length, lengthp);
-+ _gnutls_write_uint16(extdata->length - length_pos - 2,
-+ &extdata->data[length_pos]);
-
- } else { /* server */
- ver = get_version(session);
---
-2.30.2
-
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20232.patch b/gnu/packages/patches/gnutls-CVE-2021-20232.patch
deleted file mode 100644
index dc3a0be690..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20232.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 75a937d97f4fefc6f9b08e3791f151445f551cb3 Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:23 +0100
-Subject: [PATCH 2/2] pre_shared_key: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/pre_shared_key.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c
-index a042c6488..380bf39ed 100644
---- a/lib/ext/pre_shared_key.c
-+++ b/lib/ext/pre_shared_key.c
-@@ -267,7 +267,7 @@ client_send_params(gnutls_session_t session,
- size_t spos;
- gnutls_datum_t username = {NULL, 0};
- gnutls_datum_t user_key = {NULL, 0}, rkey = {NULL, 0};
-- gnutls_datum_t client_hello;
-+ unsigned client_hello_len;
- unsigned next_idx;
- const mac_entry_st *prf_res = NULL;
- const mac_entry_st *prf_psk = NULL;
-@@ -428,8 +428,7 @@ client_send_params(gnutls_session_t session,
- assert(extdata->length >= sizeof(mbuffer_st));
- assert(ext_offset >= (ssize_t)sizeof(mbuffer_st));
- ext_offset -= sizeof(mbuffer_st);
-- client_hello.data = extdata->data+sizeof(mbuffer_st);
-- client_hello.size = extdata->length-sizeof(mbuffer_st);
-+ client_hello_len = extdata->length-sizeof(mbuffer_st);
-
- next_idx = 0;
-
-@@ -440,6 +439,11 @@ client_send_params(gnutls_session_t session,
- }
-
- if (prf_res && rkey.size > 0) {
-+ gnutls_datum_t client_hello;
-+
-+ client_hello.data = extdata->data+sizeof(mbuffer_st);
-+ client_hello.size = client_hello_len;
-+
- ret = compute_psk_binder(session, prf_res,
- binders_len, binders_pos,
- ext_offset, &rkey, &client_hello, 1,
-@@ -474,6 +478,11 @@ client_send_params(gnutls_session_t session,
- }
-
- if (prf_psk && user_key.size > 0 && info) {
-+ gnutls_datum_t client_hello;
-+
-+ client_hello.data = extdata->data+sizeof(mbuffer_st);
-+ client_hello.size = client_hello_len;
-+
- ret = compute_psk_binder(session, prf_psk,
- binders_len, binders_pos,
- ext_offset, &user_key, &client_hello, 0,
---
-2.30.2
-
diff --git a/gnu/packages/patches/guile-ssh-fix-test-suite.patch b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
new file mode 100644
index 0000000000..dc10e08b0f
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
@@ -0,0 +1,217 @@
+From f7942cded8b65341916a555186e2219efe174cd0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Thu, 4 Feb 2021 14:38:25 -0500
+Subject: [PATCH] tests: Fix test suite for Guile 3.0.5.
+
+The test-runner object is now reset to #f when calling the 'test-end'
+procedure. See the commit de5d1a7f99b8e952b115237ebc29633062f99bb9 in
+Guile (srfi-64: Reset test-runner-current if done) which introduced this
+change.
+
+* tests/client-server.scm (exit-status): New variable. Use it when calling
+exit.
+* tests/dist.scm: Likewise.
+* tests/key.scm: Likewise.
+* tests/log.scm: Likewise.
+* tests/popen.scm: Likewise.
+* tests/server-client.scm: Likewise.
+* tests/server.scm: Likewise.
+* tests/session.scm: Likewise.
+* tests/shell.scm: Likewise.
+* tests/sssh-ssshd.scm: Likewise.
+* tests/tunnel.scm: Likewise.
+---
+ tests/client-server.scm | 4 +++-
+ tests/dist.scm | 4 +++-
+ tests/key.scm | 3 ++-
+ tests/log.scm | 5 ++++-
+ tests/popen.scm | 4 +++-
+ tests/server-client.scm | 4 +++-
+ tests/server.scm | 4 +++-
+ tests/session.scm | 4 +++-
+ tests/shell.scm | 3 ++-
+ tests/sssh-ssshd.scm | 4 +++-
+ tests/tunnel.scm | 4 +++-
+ 11 files changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/tests/client-server.scm b/tests/client-server.scm
+index 432a48c..fc46140 100644
+--- a/tests/client-server.scm
++++ b/tests/client-server.scm
+@@ -743,8 +743,10 @@
+
+ ;;;
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "client-server")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; client-server.scm ends here.
+diff --git a/tests/dist.scm b/tests/dist.scm
+index 2a3a75f..79f9e23 100644
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -269,8 +269,10 @@ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+ ;;;
+
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "dist")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; dist.scm ends here.
+diff --git a/tests/key.scm b/tests/key.scm
+index be31378..e1678f4 100644
+--- a/tests/key.scm
++++ b/tests/key.scm
+@@ -170,9 +170,10 @@
+ (eq? (get-key-type key) 'ecdsa-p256)))))))
+
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+
+ (test-end "key")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; key.scm ends here.
+diff --git a/tests/log.scm b/tests/log.scm
+index f547202..d528251 100644
+--- a/tests/log.scm
++++ b/tests/log.scm
+@@ -64,8 +64,11 @@
+ (get-log-verbosity))
+
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "log")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
++
+
+ ;;; log.scm ends here
+diff --git a/tests/popen.scm b/tests/popen.scm
+index e063e0b..fe77108 100644
+--- a/tests/popen.scm
++++ b/tests/popen.scm
+@@ -129,8 +129,10 @@
+ (format-log/scm 'nolog "open-remote-output-pipe" "channel: ~A" channel)
+ (output-only? channel)))))))
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "popen")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; popen.scm ends here.
+diff --git a/tests/server-client.scm b/tests/server-client.scm
+index 920aa22..b6ed3eb 100644
+--- a/tests/server-client.scm
++++ b/tests/server-client.scm
+@@ -148,8 +148,10 @@
+ (equal? x session))))))
+
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server-client")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; server-client.scm ends here.
+diff --git a/tests/server.scm b/tests/server.scm
+index c7f8b6c..1a6daea 100644
+--- a/tests/server.scm
++++ b/tests/server.scm
+@@ -157,9 +157,11 @@
+ (server-listen server)
+ #t))
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; server.scm ends here.
+
+diff --git a/tests/session.scm b/tests/session.scm
+index 8caa039..7310647 100644
+--- a/tests/session.scm
++++ b/tests/session.scm
+@@ -210,8 +210,10 @@
+ (let ((session (%make-session)))
+ (not (connected? session))))
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "session")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; session.scm ends here.
+diff --git a/tests/shell.scm b/tests/shell.scm
+index 7d613fb..e36e661 100644
+--- a/tests/shell.scm
++++ b/tests/shell.scm
+@@ -113,9 +113,10 @@
+
+
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+
+ (test-end "shell")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; shell.scm ends here.
+diff --git a/tests/sssh-ssshd.scm b/tests/sssh-ssshd.scm
+index 2fe23db..edb53fc 100644
+--- a/tests/sssh-ssshd.scm
++++ b/tests/sssh-ssshd.scm
+@@ -118,8 +118,10 @@
+ result)))
+
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "sssh-ssshd")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; sssh-ssshd.scm ends here.
+diff --git a/tests/tunnel.scm b/tests/tunnel.scm
+index ef5a568..d6453b7 100644
+--- a/tests/tunnel.scm
++++ b/tests/tunnel.scm
+@@ -191,8 +191,10 @@
+ (= pnum portnum)))
+ (eq? (channel-cancel-forward session "localhost" portnum) 'ok))))))))
+
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "tunnel")
+
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+
+ ;;; tunnel.scm ends here.
+--
+2.30.0
+
diff --git a/gnu/packages/patches/guile-ssh-read-error.patch b/gnu/packages/patches/guile-ssh-read-error.patch
new file mode 100644
index 0000000000..9cc6b048a0
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-read-error.patch
@@ -0,0 +1,18 @@
+This patch adjusts to slightly different 'read-error' in Guile 3.0.6
+compared to earlier versions:
+
+ https://github.com/artyom-poptsov/guile-ssh/issues/28
+
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -183,8 +183,8 @@ Unbound variable: e"
+ rrepl-get-result))
+
+ (test-error-with-log/= "rrepl-get-result, unknown # object error"
+- 'node-repl-error "Reader error: scm_lreadr: #<unknown port>:1:3: \
+-Unknown # object: (#\\<): scheme@(guile-user)> \
++ 'node-repl-error "Reader error: #f: #<unknown port>:1:3: \
++Unknown # object: (\"#<\"): scheme@(guile-user)> \
+ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+ (call-with-input-string
+ (string-append "scheme@(guile-user)> $4 = "
diff --git a/gnu/packages/patches/icu4c-CVE-2020-10531.patch b/gnu/packages/patches/icu4c-CVE-2020-10531.patch
deleted file mode 100644
index c2ab923bdc..0000000000
--- a/gnu/packages/patches/icu4c-CVE-2020-10531.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Fix CVE-2020-10531:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10531
-
-Patch copied from upstream source repository (changes to the test suite
-are commented out):
-
-https://github.com/unicode-org/icu/commit/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca
-
-From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
-From: Frank Tang <ftang@chromium.org>
-Date: Sat, 1 Feb 2020 02:39:04 +0000
-Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
-
-See #971
----
- icu4c/source/common/unistr.cpp | 6 ++-
- icu4c/source/test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++
- icu4c/source/test/intltest/ustrtest.h | 1 +
- 3 files changed, 68 insertions(+), 1 deletion(-)
-
-diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp
-index 901bb3358ba..077b4d6ef20 100644
---- a/icu4c/source/common/unistr.cpp
-+++ b/icu4c/source/common/unistr.cpp
-@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
- }
-
- int32_t oldLength = length();
-- int32_t newLength = oldLength + srcLength;
-+ int32_t newLength;
-+ if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
-+ setToBogus();
-+ return *this;
-+ }
-
- // Check for append onto ourself
- const UChar* oldArray = getArrayStart();
-#diff --git a/icu4c/source/test/intltest/ustrtest.cpp b/icu4c/source/test/intltest/ustrtest.cpp
-#index b6515ea813c..ad38bdf53a3 100644
-#--- a/icu4c/source/test/intltest/ustrtest.cpp
-#+++ b/icu4c/source/test/intltest/ustrtest.cpp
-#@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
-# TESTCASE_AUTO(TestWCharPointers);
-# TESTCASE_AUTO(TestNullPointers);
-# TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
-#+ TESTCASE_AUTO(TestLargeAppend);
-# TESTCASE_AUTO_END;
-# }
-#
-#@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() {
-# str.insert(2, sub);
-# assertEquals("", u"abbcdcde", str);
-# }
-#+
-#+void UnicodeStringTest::TestLargeAppend() {
-#+ if(quick) return;
-#+
-#+ IcuTestErrorCode status(*this, "TestLargeAppend");
-#+ // Make a large UnicodeString
-#+ int32_t len = 0xAFFFFFF;
-#+ UnicodeString str;
-#+ char16_t *buf = str.getBuffer(len);
-#+ // A fast way to set buffer to valid Unicode.
-#+ // 4E4E is a valid unicode character
-#+ uprv_memset(buf, 0x4e, len * 2);
-#+ str.releaseBuffer(len);
-#+ UnicodeString dest;
-#+ // Append it 16 times
-#+ // 0xAFFFFFF times 16 is 0xA4FFFFF1,
-#+ // which is greater than INT32_MAX, which is 0x7FFFFFFF.
-#+ int64_t total = 0;
-#+ for (int32_t i = 0; i < 16; i++) {
-#+ dest.append(str);
-#+ total += len;
-#+ if (total <= INT32_MAX) {
-#+ assertFalse("dest is not bogus", dest.isBogus());
-#+ } else {
-#+ assertTrue("dest should be bogus", dest.isBogus());
-#+ }
-#+ }
-#+ dest.remove();
-#+ total = 0;
-#+ for (int32_t i = 0; i < 16; i++) {
-#+ dest.append(str);
-#+ total += len;
-#+ if (total + len <= INT32_MAX) {
-#+ assertFalse("dest is not bogus", dest.isBogus());
-#+ } else if (total <= INT32_MAX) {
-#+ // Check that a string of exactly the maximum size works
-#+ UnicodeString str2;
-#+ int32_t remain = INT32_MAX - total;
-#+ char16_t *buf2 = str2.getBuffer(remain);
-#+ if (buf2 == nullptr) {
-#+ // if somehow memory allocation fail, return the test
-#+ return;
-#+ }
-#+ uprv_memset(buf2, 0x4e, remain * 2);
-#+ str2.releaseBuffer(remain);
-#+ dest.append(str2);
-#+ total += remain;
-#+ assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total);
-#+ assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length());
-#+ assertFalse("dest is not bogus", dest.isBogus());
-#+
-#+ // Check that a string size+1 goes bogus
-#+ str2.truncate(1);
-#+ dest.append(str2);
-#+ total++;
-#+ assertTrue("dest should be bogus", dest.isBogus());
-#+ } else {
-#+ assertTrue("dest should be bogus", dest.isBogus());
-#+ }
-#+ }
-#+}
-#diff --git a/icu4c/source/test/intltest/ustrtest.h b/icu4c/source/test/intltest/ustrtest.h
-#index 218befdcc68..4a356a92c7a 100644
-#--- a/icu4c/source/test/intltest/ustrtest.h
-#+++ b/icu4c/source/test/intltest/ustrtest.h
-#@@ -97,6 +97,7 @@ class UnicodeStringTest: public IntlTest {
-# void TestWCharPointers();
-# void TestNullPointers();
-# void TestUnicodeStringInsertAppendToSelf();
-#+ void TestLargeAppend();
-# };
-#
-# #endif
diff --git a/gnu/packages/patches/inetutils-hurd.patch b/gnu/packages/patches/inetutils-hurd.patch
deleted file mode 100644
index bd65c4feb1..0000000000
--- a/gnu/packages/patches/inetutils-hurd.patch
+++ /dev/null
@@ -1,583 +0,0 @@
-Support compiling on the Hurd.
-
-Taken from https://git.hadrons.org/cgit/debian/pkgs/inetutils.git/tree/debian/patches/0002-ifconfig-Improve-the-support-for-GNU-Hurd.patch
-
-From 9a90d9b9119906df23cb2db1503cb0f099942dd9 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Sat, 18 Jul 2015 01:12:41 +0200
-Subject: [PATCH 02/35] ifconfig: Improve the support for GNU/Hurd.
-
-Use system specific code instead of generic code.
-This provides abilities similar to other systems.
----
- ChangeLog | 17 +++
- ifconfig/system.c | 10 +-
- ifconfig/system.h | 2 +
- ifconfig/system/Makefile.am | 4 +-
- ifconfig/system/generic.c | 14 +-
- ifconfig/system/hurd.c | 292 ++++++++++++++++++++++++++++++++++++
- ifconfig/system/hurd.h | 50 ++++++
- 7 files changed, 381 insertions(+), 8 deletions(-)
- create mode 100644 ifconfig/system/hurd.c
- create mode 100644 ifconfig/system/hurd.h
-
-diff --git a/ifconfig/system.c b/ifconfig/system.c
-index 30677e41..e108dc2e 100644
---- a/ifconfig/system.c
-+++ b/ifconfig/system.c
-@@ -25,10 +25,12 @@
- # include "system/solaris.c"
- #elif defined __QNX__
- # include "system/qnx.c"
--# elif defined __DragonFly__ || defined __FreeBSD__ || \
-- defined __FreeBSD_kernel__ || \
-- defined __NetBSD__ || defined __OpenBSD__
--# include "system/bsd.c"
-+#elif defined __DragonFly__ || defined __FreeBSD__ || \
-+ defined __FreeBSD_kernel__ || \
-+ defined __NetBSD__ || defined __OpenBSD__
-+# include "system/bsd.c"
-+#elif defined __GNU__
-+# include "system/hurd.c"
- #else
- # include "system/generic.c"
- #endif
-diff --git a/ifconfig/system.h b/ifconfig/system.h
-index 8521ad95..66878d3a 100644
---- a/ifconfig/system.h
-+++ b/ifconfig/system.h
-@@ -97,6 +97,8 @@ extern struct if_nameindex* (*system_if_nameindex) (void);
- defined __FreeBSD_kernel__ || \
- defined __NetBSD__ || defined __OpenBSD__
- # include "system/bsd.h"
-+# elif defined __GNU__
-+# include "system/hurd.h"
- # else
- # include "system/generic.h"
- # endif
-diff --git a/ifconfig/system/Makefile.am b/ifconfig/system/Makefile.am
-index 954c6774..62a9f1c4 100644
---- a/ifconfig/system/Makefile.am
-+++ b/ifconfig/system/Makefile.am
-@@ -26,8 +26,10 @@ noinst_HEADERS = \
- linux.h \
- solaris.h \
- qnx.h \
-+ hurd.h \
- bsd.c \
- generic.c \
- linux.c \
- solaris.c \
-- qnx.c
-+ qnx.c \
-+ hurd.c
-diff --git a/ifconfig/system/generic.c b/ifconfig/system/generic.c
-index 9a2bda55..20a78bde 100644
---- a/ifconfig/system/generic.c
-+++ b/ifconfig/system/generic.c
-@@ -22,6 +22,8 @@
- #include <config.h>
-
- #include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
-
-
- /* Output format stuff. */
-@@ -36,19 +38,25 @@ const char *system_help;
- struct argp_child system_argp_child;
-
- int
--system_parse_opt (struct ifconfig **ifp, char option, char *optarg)
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+ char option _GL_UNUSED_PARAMETER,
-+ char *optarg _GL_UNUSED_PARAMETER)
- {
- return 0;
- }
-
- int
--system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+system_parse_opt_rest (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+ int argc _GL_UNUSED_PARAMETER,
-+ char *argv[] _GL_UNUSED_PARAMETER)
- {
- return 0;
- }
-
- int
--system_configure (int sfd, struct ifreq *ifr, struct system_ifconfig *ifs)
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+ struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+ struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
- {
- return 0;
- }
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-new file mode 100644
-index 00000000..3bd19775
---- /dev/null
-+++ b/ifconfig/system/hurd.c
-@@ -0,0 +1,292 @@
-+/* hurd.c -- Code for ifconfig specific to GNU/Hurd.
-+ Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+ This file is part of GNU Inetutils.
-+
-+ GNU Inetutils is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or (at
-+ your option) any later version.
-+
-+ GNU Inetutils is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Mostly written by Marcus Brinkmann.
-+ Adaptions to GNU/Hurd by Mats Erik Andersson. */
-+
-+#include <config.h>
-+
-+#include <stdlib.h>
-+#include <sys/ioctl.h>
-+#include <net/if_arp.h>
-+#include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
-+
-+
-+/* Output format stuff. */
-+
-+const char *system_default_format = "gnu";
-+
-+
-+/* Argument parsing stuff. */
-+
-+const char *system_help = "NAME [ADDR]\
-+ [broadcast BRDADDR] [netmask MASK]\
-+ [mtu N] [up|down] [FLAGS]";
-+
-+struct argp_child system_argp_child;
-+
-+int
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+ char option _GL_UNUSED_PARAMETER,
-+ char *optarg _GL_UNUSED_PARAMETER)
-+{
-+ return 0;
-+}
-+
-+int
-+system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+{
-+ int i = 0, mask, rev;
-+ enum {
-+ EXPECT_NOTHING,
-+ EXPECT_AF,
-+ EXPECT_BROADCAST,
-+ EXPECT_NETMASK,
-+ EXPECT_METRIC,
-+ EXPECT_MTU
-+ } expect = EXPECT_AF;
-+
-+ *ifp = parse_opt_new_ifs (argv[0]);
-+
-+ while (++i < argc)
-+ {
-+ switch (expect)
-+ {
-+ case EXPECT_BROADCAST:
-+ parse_opt_set_brdaddr (*ifp, argv[i]);
-+ break;
-+
-+ case EXPECT_NETMASK:
-+ parse_opt_set_netmask (*ifp, argv[i]);
-+ break;
-+
-+ case EXPECT_MTU:
-+ parse_opt_set_mtu (*ifp, argv[i]);
-+ break;
-+
-+ /* XXX: 2015-07-18, GNU/Hurd does not yet support
-+ ioctl(SIOCSIFMETRIC), but we let the code
-+ handle this standard ability anyway!
-+ */
-+ case EXPECT_METRIC:
-+ parse_opt_set_metric (*ifp, argv[i]);
-+ break;
-+
-+ case EXPECT_AF:
-+ expect = EXPECT_NOTHING;
-+ if (!strcmp (argv[i], "inet"))
-+ continue;
-+ else if (!strcmp (argv[i], "inet6"))
-+ {
-+ error (0, 0, "%s is not a supported address family", argv[i]);
-+ return 0;
-+ }
-+ break;
-+
-+ case EXPECT_NOTHING:
-+ break;
-+ }
-+
-+ if (expect != EXPECT_NOTHING)
-+ expect = EXPECT_NOTHING;
-+ else if (!strcmp (argv[i], "broadcast"))
-+ expect = EXPECT_BROADCAST;
-+ else if (!strcmp (argv[i], "netmask"))
-+ expect = EXPECT_NETMASK;
-+ else if (!strcmp (argv[i], "metric"))
-+ expect = EXPECT_METRIC;
-+ else if (!strcmp (argv[i], "mtu"))
-+ expect = EXPECT_MTU;
-+ else if (!strcmp (argv[i], "up"))
-+ parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
-+ else if (!strcmp (argv[i], "down"))
-+ parse_opt_set_flag (*ifp, IFF_UP, 1);
-+ else if (((mask = if_nameztoflag (argv[i], &rev))
-+ & ~IU_IFF_CANTCHANGE) != 0)
-+ parse_opt_set_flag (*ifp, mask, rev);
-+ else
-+ {
-+ if (!((*ifp)->valid & IF_VALID_ADDR))
-+ parse_opt_set_address (*ifp, argv[i]);
-+ else if (!((*ifp)->valid & IF_VALID_DSTADDR))
-+ parse_opt_set_dstaddr (*ifp, argv[i]);
-+ }
-+ }
-+
-+ switch (expect)
-+ {
-+ case EXPECT_BROADCAST:
-+ error (0, 0, "option `broadcast' requires an argument");
-+ break;
-+
-+ case EXPECT_NETMASK:
-+ error (0, 0, "option `netmask' requires an argument");
-+ break;
-+
-+ case EXPECT_METRIC:
-+ error (0, 0, "option `metric' requires an argument");
-+ break;
-+
-+ case EXPECT_MTU:
-+ error (0, 0, "option `mtu' requires an argument");
-+ break;
-+
-+ case EXPECT_AF:
-+ case EXPECT_NOTHING:
-+ return 1;
-+ }
-+
-+ return 0;
-+}
-+
-+int
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+ struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+ struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
-+{
-+ return 0;
-+}
-+
-+struct if_nameindex* (*system_if_nameindex) (void) = if_nameindex;
-+
-+static void
-+print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
-+ unsigned char *data)
-+{
-+ *column += printf ("%02X:%02X:%02X:%02X:%02X:%02X",
-+ data[0], data[1], data[2], data[3], data[4], data[5]);
-+ had_output = 1;
-+}
-+
-+struct arphrd_symbol
-+{
-+ const char *name;
-+ const char *title;
-+ int value;
-+ void (*print_hwaddr) (format_data_t form, unsigned char *data);
-+} arphrd_symbols[] =
-+ {
-+#ifdef ARPHRD_ETHER /* Ethernet 10/100Mbps. */
-+ { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+#endif
-+#ifdef ARPHRD_LOOPBACK /* Loopback device. */
-+ { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+#endif
-+ /* XXX: The image debian-hurd-20150424 returns the value 4
-+ instead of expected ARPHRD_LOOPBACK. This has been
-+ discussed in the list debian-hurd, where I was asked
-+ to resist the temptation of a work around!
-+ */
-+ { NULL, NULL, 0, NULL}
-+ };
-+
-+struct arphrd_symbol *
-+arphrd_findvalue (int value)
-+{
-+ struct arphrd_symbol *arp = arphrd_symbols;
-+ while (arp->name != NULL)
-+ {
-+ if (arp->value == value)
-+ break;
-+ arp++;
-+ }
-+ if (arp->name)
-+ return arp;
-+ else
-+ return NULL;
-+}
-+
-+void
-+system_fh_hwaddr_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+ struct arphrd_symbol *arp;
-+
-+ if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+ select_arg (form, argc, argv, 1);
-+
-+ arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+ select_arg (form, argc, argv, (arp && arp->print_hwaddr) ? 0 : 1);
-+#else
-+ select_arg (form, argc, argv, 1);
-+#endif
-+}
-+
-+void
-+system_fh_hwaddr (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+ char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+ if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+ error (EXIT_FAILURE, errno,
-+ "SIOCGIFHWADDR failed for interface `%s'",
-+ form->ifr->ifr_name);
-+ else
-+ {
-+ struct arphrd_symbol *arp;
-+
-+ arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+ if (arp && arp->print_hwaddr)
-+ arp->print_hwaddr (form,
-+ (unsigned char *) form->ifr->ifr_hwaddr.sa_data);
-+ else
-+ put_string (form, "(hwaddr unknown)");
-+ }
-+#else
-+ *column += printf ("(not available)");
-+ had_output = 1;
-+#endif
-+}
-+
-+void
-+system_fh_hwtype_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+ if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) >= 0)
-+ select_arg (form, argc, argv, 0);
-+ else
-+#endif
-+ select_arg (form, argc, argv, 1);
-+}
-+
-+void
-+system_fh_hwtype (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+ char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+ if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+ error (EXIT_FAILURE, errno,
-+ "SIOCGIFHWADDR failed for interface `%s'",
-+ form->ifr->ifr_name);
-+ else
-+ {
-+ struct arphrd_symbol *arp;
-+
-+ arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+ if (arp)
-+ put_string (form, arp->title);
-+ else
-+ put_string (form, "(hwtype unknown)");
-+ }
-+#else
-+ *column += printf ("(not available)");
-+ had_output = 1;
-+#endif
-+}
-diff --git a/ifconfig/system/hurd.h b/ifconfig/system/hurd.h
-new file mode 100644
-index 00000000..bab14565
---- /dev/null
-+++ b/ifconfig/system/hurd.h
-@@ -0,0 +1,50 @@
-+/*
-+ Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+ This file is part of GNU Inetutils.
-+
-+ GNU Inetutils is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or (at
-+ your option) any later version.
-+
-+ GNU Inetutils is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Written by Mats Erik Andersson. */
-+
-+#ifndef IFCONFIG_SYSTEM_HURD_H
-+# define IFCONFIG_SYSTEM_HURD_H
-+
-+# include "../printif.h"
-+# include "../options.h"
-+
-+
-+/* Option support. */
-+
-+struct system_ifconfig
-+{
-+ int valid;
-+};
-+
-+
-+/* Output format support. */
-+
-+# define SYSTEM_FORMAT_HANDLER \
-+ { "hurd", fh_nothing}, \
-+ { "hwaddr?", system_fh_hwaddr_query}, \
-+ { "hwaddr", system_fh_hwaddr}, \
-+ { "hwtype?", system_fh_hwtype_query}, \
-+ { "hwtype", system_fh_hwtype},
-+
-+void system_fh_hwaddr_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwaddr (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype (format_data_t form, int argc, char *argv[]);
-+
-+#endif /* !IFCONFIG_SYSTEM_HURD_H */
---
-2.23.0.rc1.170.gbd704faa3e
-
-From 589dab9c7d3119da82837dabae34c8a3d16cbe49 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Thu, 30 Jul 2015 01:06:42 +0200
-Subject: [PATCH 07/35] ifconfig: Hardware detection in GNU/Hurd.
-
-A work-around needed to distinguish hardware type.
----
- ChangeLog | 10 ++++++++++
- ifconfig/system/hurd.c | 19 ++++++++++++-------
- 2 files changed, 22 insertions(+), 7 deletions(-)
-
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-index 3bd19775..b6261a00 100644
---- a/ifconfig/system/hurd.c
-+++ b/ifconfig/system/hurd.c
-@@ -175,6 +175,16 @@ print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
- had_output = 1;
- }
-
-+/* GNU/Hurd and Mach are using a mixture of BSD definitions
-+ * and GNU/Linux interface headers, which in this situation
-+ * means that sa_family_t is an unsigned char, from BSD, while
-+ * all ARPHRD_* come from GNU/Linux and are thus 16 bits wide.
-+ * We must account for this. The following bitmask will
-+ * adapt to any future change!
-+ */
-+
-+#define _ARP_MASK ((sizeof (sa_family_t) == 1) ? 0xff : 0xffff)
-+
- struct arphrd_symbol
- {
- const char *name;
-@@ -184,16 +194,11 @@ struct arphrd_symbol
- } arphrd_symbols[] =
- {
- #ifdef ARPHRD_ETHER /* Ethernet 10/100Mbps. */
-- { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+ { "ETHER", "Ethernet", ARPHRD_ETHER & _ARP_MASK, print_hwaddr_ether},
- #endif
- #ifdef ARPHRD_LOOPBACK /* Loopback device. */
-- { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+ { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK & _ARP_MASK, NULL},
- #endif
-- /* XXX: The image debian-hurd-20150424 returns the value 4
-- instead of expected ARPHRD_LOOPBACK. This has been
-- discussed in the list debian-hurd, where I was asked
-- to resist the temptation of a work around!
-- */
- { NULL, NULL, 0, NULL}
- };
-
---
-2.23.0.rc1.170.gbd704faa3e
-
-From d379784b4461d17b2536effd1b52bae21cd28a32 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Fri, 16 Aug 2019 00:34:03 +0200
-Subject: [PATCH 35/35] telnet: Several ioctls have been disabled in the Hurd's
- glibc
-
-But not the related option macros. inetutils uses those macros to decide
-whether the ioctls are available, so it is FTBFS now. The Hurd's glibc
-is being fixed, but we'll use this for now to get the builds going.
----
- telnet/sys_bsd.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
-index 662536ab..5eb35cb5 100644
---- a/telnet/sys_bsd.c
-+++ b/telnet/sys_bsd.c
-@@ -63,6 +63,7 @@
- #include <errno.h>
- #include <arpa/telnet.h>
- #include <sys/select.h>
-+#include <sys/ioctl.h>
- #include <unused-parameter.h>
-
- #include "ring.h"
-@@ -157,7 +158,7 @@ TerminalRead (char *buf, int n)
- int
- TerminalAutoFlush (void)
- {
--#if defined LNOFLSH
-+#if defined TIOCLGET && defined LNOFLSH
- int flush;
-
- ioctl (0, TIOCLGET, (char *) &flush);
-@@ -260,7 +261,9 @@ TerminalSaveState (void)
- ioctl (0, TIOCGETP, (char *) &ottyb);
- ioctl (0, TIOCGETC, (char *) &otc);
- ioctl (0, TIOCGLTC, (char *) &oltc);
-+#ifdef TIOCLGET
- ioctl (0, TIOCLGET, (char *) &olmode);
-+#endif
-
- ntc = otc;
- nltc = oltc;
-@@ -755,7 +758,9 @@ TerminalNewMode (register int f)
- #endif
- }
- #ifndef USE_TERMIO
-+#ifdef TIOCLSET
- ioctl (tin, TIOCLSET, (char *) &lmode);
-+#endif
- ioctl (tin, TIOCSLTC, (char *) &ltc);
- ioctl (tin, TIOCSETC, (char *) &tc);
- ioctl (tin, TIOCSETN, (char *) &sb);
---
-2.23.0.rc1.170.gbd704faa3e
-
diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
deleted file mode 100644
index e4897de1b8..0000000000
--- a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-This patch fixes a bug and related test failure on platforms where 'char'
-is unsigned.
-
-Taken from upstream:
-https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb
-
-diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
-index 8e06cca2..56195dc1 100644
---- a/src/lib_json/json_writer.cpp
-+++ b/src/lib_json/json_writer.cpp
-@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
-
- char const* const end = s + n;
- for (char const* cur = s; cur < end; ++cur) {
-- if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
-- static_cast<unsigned char>(*cur) < 0x80)
-+ if (*cur == '\\' || *cur == '\"' ||
-+ static_cast<unsigned char>(*cur) < ' ' ||
-+ static_cast<unsigned char>(*cur) >= 0x80)
- return true;
- }
- return false;
diff --git a/gnu/packages/patches/lcms-CVE-2018-16435.patch b/gnu/packages/patches/lcms-CVE-2018-16435.patch
deleted file mode 100644
index 60228e73af..0000000000
--- a/gnu/packages/patches/lcms-CVE-2018-16435.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8.patch
-
-From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
-From: Marti Maria <info@littlecms.com>
-Date: Wed, 15 Aug 2018 20:07:56 +0200
-Subject: [PATCH] Upgrade Visual studio 2017 15.8
-
-- Upgrade to 15.8
-- Add check on CGATS memory allocation (thanks to Quang Nguyen for
-pointing out this)
----
- Projects/VC2017/jpegicc/jpegicc.vcxproj | 1 +
- Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj | 2 +-
- Projects/VC2017/lcms2_static/lcms2_static.vcxproj | 2 +-
- Projects/VC2017/linkicc/linkicc.vcxproj | 2 +-
- Projects/VC2017/psicc/psicc.vcxproj | 2 +-
- Projects/VC2017/testbed/testbed.vcxproj | 2 +-
- Projects/VC2017/tiffdiff/tiffdiff.vcxproj | 2 +-
- Projects/VC2017/tifficc/tifficc.vcxproj | 2 +-
- Projects/VC2017/transicc/transicc.vcxproj | 1 +
- src/cmscgats.c | 14 ++++++++++----
- 10 files changed, 19 insertions(+), 11 deletions(-)
-
-diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-index ab26a53..39cfd00 100644
---- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
-+++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-@@ -22,6 +22,7 @@
- <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
- <RootNamespace>jpegicc</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-index 4c8aa3f..d1bf3eb 100644
---- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-+++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
- <RootNamespace>lcms2_DLL</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-index 2a9988a..9fc05ce 100644
---- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-+++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
- <RootNamespace>lcms2_static</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj
-index 30c2b4e..51586dd 100644
---- a/Projects/VC2017/linkicc/linkicc.vcxproj
-+++ b/Projects/VC2017/linkicc/linkicc.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
- <RootNamespace>linkicc</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj
-index 9dcf89a..8f26e12 100644
---- a/Projects/VC2017/psicc/psicc.vcxproj
-+++ b/Projects/VC2017/psicc/psicc.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
- <RootNamespace>psicc</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj
-index 0af3762..3f6aea3 100644
---- a/Projects/VC2017/testbed/testbed.vcxproj
-+++ b/Projects/VC2017/testbed/testbed.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
- <RootNamespace>testbed</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-index 7edfe28..3a6d837 100644
---- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-+++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
- <RootNamespace>tiffdiff</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj
-index cd9f04c..5ef954f 100644
---- a/Projects/VC2017/tifficc/tifficc.vcxproj
-+++ b/Projects/VC2017/tifficc/tifficc.vcxproj
-@@ -22,7 +22,7 @@
- <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
- <RootNamespace>tifficc</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj
-index d9b77c6..b3173d8 100644
---- a/Projects/VC2017/transicc/transicc.vcxproj
-+++ b/Projects/VC2017/transicc/transicc.vcxproj
-@@ -22,6 +22,7 @@
- <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
- <RootNamespace>transicc</RootNamespace>
- <Keyword>Win32Proj</Keyword>
-+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/src/cmscgats.c b/src/cmscgats.c
-index 1a87613..8c3e96d 100644
---- a/src/cmscgats.c
-+++ b/src/cmscgats.c
-@@ -1,7 +1,7 @@
- //---------------------------------------------------------------------------------
- //
- // Little Color Management System
--// Copyright (c) 1998-2017 Marti Maria Saguer
-+// Copyright (c) 1998-2018 Marti Maria Saguer
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the "Software"),
-@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
- t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
- t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
-
-- t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
-- if (t->Data == NULL) {
-+ if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
-+ {
-+ SynError(it8, "AllocateDataSet: too much data");
-+ }
-+ else {
-+ t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
-+ if (t->Data == NULL) {
-
-- SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+ SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+ }
- }
-
- }
diff --git a/gnu/packages/patches/libtirpc-hurd-client.patch b/gnu/packages/patches/libtirpc-hurd-client.patch
deleted file mode 100644
index 526ad262d2..0000000000
--- a/gnu/packages/patches/libtirpc-hurd-client.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/06-hurd-client-port.diff
-
-Description: Fix client code for hurd, avoiding malloc overflow
- When trying to setup a inet connection, it happens the following:
- - in libtirp, src/clnt_vc.c, clnt_vc_create gets called
- - when trying to allocate vc_fd_locks, __rpc_dtbsize() is used as size
- for that array of fd locks
- - __rpc_dtbsize(), in src/rpc_generic.c, queries using rlimit the
- maximum (rlim_max) number of file descriptors (RLIMIT_NOFILE):
- - on Linux, the default is { rlim_cur = 1024, rlim_max = 4096 }
- - on kFreeBSD, the default is { rlim_cur = 1024, rlim_max = 1024 }
- - on Hurd, the default is { rlim_cur = 1024, rlim_max = RLIM_INFINITY }
- meaning that on Hurd the memory allocation fails (as
- __rpc_dtbsize() * sizeof(int) overflows and is negative)
-
- Change libtiprc so __rpc_dtbsize falls back on rlim_cur if rlim_max
- is unlimited.
-
- This patch fixes the client connection using inet sockets; local unix
- sockets are not working, for two reasons so far:
- - getpeername on them gives EOPNOTSUPP
- - SO_REUSEADDR is not implemented for them
-Author: Pino Toscano <pino@debian.org>
-
-Bug-Debian: http://bugs.debian.org/739674
-Forwarded: no
-Reviewed-By: Petter Reinholdtsen
-Last-Update: 2014-03-03
-
---- a/src/rpc_generic.c
-+++ b/src/rpc_generic.c
-@@ -107,12 +107,17 @@
- {
- static int tbsize;
- struct rlimit rl;
-+ rlim_t lim;
-
- if (tbsize) {
- return (tbsize);
- }
- if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
-- return (tbsize = (int)rl.rlim_max);
-+ lim = rl.rlim_max;
-+ if (lim == RLIM_INFINITY) {
-+ lim = rl.rlim_cur;
-+ }
-+ return (tbsize = (int)lim);
- }
- /*
- * Something wrong. I'll try to save face by returning a
diff --git a/gnu/packages/patches/libxt-guix-search-paths.patch b/gnu/packages/patches/libxt-guix-search-paths.patch
index 5419edd1bd..61022d232a 100644
--- a/gnu/packages/patches/libxt-guix-search-paths.patch
+++ b/gnu/packages/patches/libxt-guix-search-paths.patch
@@ -1,13 +1,9 @@
diff --git a/src/Intrinsic.c b/src/Intrinsic.c
-index c9624ec..addcdba 100644
--- a/src/Intrinsic.c
+++ b/src/Intrinsic.c
-@@ -1312,21 +1312,101 @@ static void FillInLangSubs(
- } else (void) strcpy(*rest, string);
+@@ -1345,21 +1345,99 @@ FillInLangSubs(Substitution subs, XtPerDisplay pd)
}
-+
-+
/*
- * default path used if environment variable XFILESEARCHPATH
- * is not defined. Also substitued for %D.
@@ -24,8 +20,9 @@ index c9624ec..addcdba 100644
+ These values provide the default paths where Guix/GuixSD can expect
+ to find resources for installed packages.
*/
--static const char *implementation_default_path(void)
-+static const char *guix_default_path(void)
+ static const char *
+-implementation_default_path(void)
++guix_default_path(void)
{
-#if defined(WIN32)
- static char xfilesearchpath[] = "";
@@ -115,7 +112,7 @@ index c9624ec..addcdba 100644
}
-@@ -1354,7 +1434,7 @@ _XtString XtResolvePathname(
+@@ -1388,7 +1466,7 @@ XtResolvePathname(Display *dpy,
{
XtPerDisplay pd;
static const char *defaultPath = NULL;
diff --git a/gnu/packages/patches/mariadb-cmake-compat.patch b/gnu/packages/patches/mariadb-cmake-compat.patch
new file mode 100644
index 0000000000..44b0daa186
--- /dev/null
+++ b/gnu/packages/patches/mariadb-cmake-compat.patch
@@ -0,0 +1,17 @@
+Fix if statement that triggers syntax error in CMake 3.20 and later.
+
+Taken from upstream:
+https://github.com/mariadb-corporation/mariadb-connector-c/commit/242cab8c
+
+diff --git a/libmariadb/cmake/ConnectorName.cmake b/libmariadb/cmake/ConnectorName.cmake
+--- a/libmariadb/cmake/ConnectorName.cmake
++++ b/libmariadb/cmake/ConnectorName.cmake
+@@ -22,7 +22,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ SET(MACHINE_NAME "x64")
+ ELSE()
+ SET(MACHINE_NAME "32")
+- END()
++ ENDIF()
+ ENDIF()
+
+ SET(product_name "mysql-connector-c-${CPACK_PACKAGE_VERSION}-${PLATFORM_NAME}${CONCAT_SIGN}${MACHINE_NAME}") \ No newline at end of file
diff --git a/gnu/packages/patches/meson-for-build-rpath.patch b/gnu/packages/patches/meson-for-build-rpath.patch
deleted file mode 100644
index ef9a73f07c..0000000000
--- a/gnu/packages/patches/meson-for-build-rpath.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-This patch removes a part of meson that clears the rpath upon installation.
-This will only be applied to a special version of meson, used for the
-meson-build-system.
-
-Original patch for Meson 0.42.0 by Peter Mikkelsen <petermikkelsen10@gmail.com>
-
---- meson-0.47.1/mesonbuild/minstall.py.old 2018-08-10 11:01:27.812327013 +0200
-+++ meson-0.47.1/mesonbuild/minstall.py 2018-08-10 11:01:51.940368505 +0200
-@@ -436,15 +436,6 @@
- print("Symlink creation does not work on this platform. "
- "Skipping all symlinking.")
- printed_symlink_error = True
-- if os.path.isfile(outname):
-- try:
-- depfixer.fix_rpath(outname, install_rpath, final_path,
-- install_name_mappings, verbose=False)
-- except SystemExit as e:
-- if isinstance(e.code, int) and e.code == 0:
-- pass
-- else:
-- raise
-
- def run(args):
- parser = buildparser()
diff --git a/gnu/packages/patches/mit-krb5-hurd.patch b/gnu/packages/patches/mit-krb5-hurd.patch
index d4962b1e60..449320cea4 100644
--- a/gnu/packages/patches/mit-krb5-hurd.patch
+++ b/gnu/packages/patches/mit-krb5-hurd.patch
@@ -148,18 +148,3 @@ index 7e981d4..d83b3b6 100644
+# define MAXPATHLEN 4096
+#endif
#endif /* _DB_INT_H_ */
-diff --git a/src/tests/resolve/resolve.c b/src/tests/resolve/resolve.c
-index 7339d21..38f7253 100644
---- a/src/tests/resolve/resolve.c
-+++ b/src/tests/resolve/resolve.c
-@@ -73,6 +73,10 @@ char *strchr();
- #include <netinet/in.h>
- #include <netdb.h>
-
-+#ifndef MAXHOSTNAMELEN
-+# define MAXHOSTNAMELEN 256
-+#endif
-+
- int
- main(argc, argv)
- int argc;
diff --git a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
deleted file mode 100644
index 491a358731..0000000000
--- a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix a null pointer dereference when no DNS search path is configured.
-This showed up as a segfault while running the gsasl test suite.
-
-Taken from upstream:
-https://github.com/krb5/krb5/commit/cd82bf377e7fad2409c76bf8b241920692f34fda
-
-diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
-index e35ca9d76c..0cd213fdd7 100644
---- a/src/lib/krb5/os/dnsglue.c
-+++ b/src/lib/krb5/os/dnsglue.c
-@@ -91,7 +91,7 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h) struct __res_state h
- #define INIT_HANDLE(h) (memset(&h, 0, sizeof(h)), res_ninit(&h) == 0)
- #define SEARCH(h, n, c, t, a, l) res_nsearch(&h, n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(h.dnsrch[0])
-+#define PRIMARY_DOMAIN(h) ((h.dnsrch[0] == NULL) ? NULL : strdup(h.dnsrch[0]))
- #if HAVE_RES_NDESTROY
- #define DESTROY_HANDLE(h) res_ndestroy(&h)
- #else
-@@ -104,7 +104,8 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h)
- #define INIT_HANDLE(h) (res_init() == 0)
- #define SEARCH(h, n, c, t, a, l) res_search(n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(_res.defdname)
-+#define PRIMARY_DOMAIN(h) \
-+ ((_res.defdname == NULL) ? NULL : strdup(_res.defdname))
- #define DESTROY_HANDLE(h)
-
- #endif
diff --git a/gnu/packages/patches/nss-getcwd-nonnull.patch b/gnu/packages/patches/nss-getcwd-nonnull.patch
new file mode 100644
index 0000000000..37c1b1c539
--- /dev/null
+++ b/gnu/packages/patches/nss-getcwd-nonnull.patch
@@ -0,0 +1,30 @@
+Disable -Werror=nonnull on getcwd(0, 4096) because GCC incorrectly warns that
+the second argument should be NULL with recent glibc. See:
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832
+https://sourceware.org/bugzilla/show_bug.cgi?id=26545
+
+diff --git a/nss/coreconf/nsinstall/nsinstall.c b/nss/coreconf/nsinstall/nsinstall.c
+--- a/nss/coreconf/nsinstall/nsinstall.c
++++ b/nss/coreconf/nsinstall/nsinstall.c
+@@ -236,14 +236,20 @@ main(int argc, char **argv)
+ return 0;
+
+ if (!cwd) {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ cwd = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ if (!cwd)
+ fail("could not get CWD");
+ }
+
+ /* make sure we can get into todir. */
+ xchdir(todir);
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ todir = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ if (!todir)
+ fail("could not get CWD in todir");
+ tdlen = strlen(todir);
diff --git a/gnu/packages/patches/perl-deterministic-ordering.patch b/gnu/packages/patches/perl-deterministic-ordering.patch
deleted file mode 100644
index be63d5cde3..0000000000
--- a/gnu/packages/patches/perl-deterministic-ordering.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From <https://bugs.debian.org/801523>.
-
-From c01f602d1926b0671fd2c8d91f7e52c4e4c9fb24 Mon Sep 17 00:00:00 2001
-From: Niko Tyni <ntyni@debian.org>
-Date: Sun, 11 Oct 2015 19:27:56 +0300
-Subject: [PATCH] Sort the list of XS code files when generating RealPPPort.xs
-
-all_files_in_dir() uses readdir() ordering to make the list of
-input files. This can vary between build systems, breaking build
-reproducibility.
----
- cpan/Devel-PPPort/PPPort_xs.PL | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dist/Devel-PPPort/PPPort_xs.PL b/dist/Devel-PPPort/PPPort_xs.PL
-index 5f18940..149f2fe 100644
---- a/dist/Devel-PPPort/PPPort_xs.PL
-+++ b/dist/Devel-PPPort/PPPort_xs.PL
-@@ -38,7 +38,7 @@ END
- my $file;
- my $sec;
-
--for $file (all_files_in_dir('parts/inc')) {
-+for $file (sort(all_files_in_dir('parts/inc'))) {
- my $spec = parse_partspec($file);
-
- my $msg = 0;
---
-2.5.1
diff --git a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch b/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
deleted file mode 100644
index f2166aebfd..0000000000
--- a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Work around a problem arising from the update to OpenSSL 1.0.2f, based on the
-following upstream commit:
-
- https://github.com/noxxi/p5-io-socket-ssl/commit/6e23ee4a433f83f1065bd2467255eba5ee9b1ddd
-
-Attempting to update to IO-Socket-SSL-2.023, which includes this commit,
-caused other test failures. See:
-
- https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01032.html
-
-Description from the upstream commit:
-
- OpenSSL 1.0.2f changed the behavior of SSL shutdown in case the TLS connection
- was not fully established (commit: f73c737c7ac908c5d6407c419769123392a3b0a9).
- This somehow resulted in Net::SSLeay::shutdown returning 0 (i.e. keep trying)
- which caused an endless loop. It will now ignore this result in case the TLS
- connection was not yet established and consider the TLS connection closed
- instead.
-
---- IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm.orig 2014-10-21 16:51:16.000000000 -0400
-+++ IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm 2016-01-31 15:07:14.971099894 -0500
-@@ -1213,6 +1213,11 @@
- # shutdown complete
- last;
- }
-+ if ((${*$self}{'_SSL_opened'}||0) <= 0) {
-+ # not really open, thus don't expect shutdown to return
-+ # something meaningful
-+ last;
-+ }
-
- # initiate or complete shutdown
- local $SIG{PIPE} = 'IGNORE';
diff --git a/gnu/packages/patches/perl-no-sys-dirs.patch b/gnu/packages/patches/perl-no-sys-dirs.patch
index 2269d715c7..14d634cac9 100644
--- a/gnu/packages/patches/perl-no-sys-dirs.patch
+++ b/gnu/packages/patches/perl-no-sys-dirs.patch
@@ -6,7 +6,7 @@ Patch adapted from Nixpkgs, originally by Eelco Dolstra
diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
--- perl-5.20.0-orig/Configure 2014-05-26 15:34:18.000000000 +0200
+++ perl-5.20.0/Configure 2014-06-25 10:43:35.368285986 +0200
-@@ -106,15 +106,7 @@
+@@ -108,15 +108,7 @@
fi
: Proper PATH setting
@@ -23,8 +23,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
for p in $paths
do
-@@ -1337,8 +1329,7 @@
- archname=''
+@@ -1435,8 +1427,7 @@
+ i_whoami=''
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
@@ -33,8 +33,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
:
: no include file wanted by default
inclwanted=''
-@@ -1349,17 +1340,12 @@
-
+@@ -1450,17 +1441,12 @@
+ archobjs=''
libnames=''
: change the next line if compiling for Xenix/286 on Xenix/386
-xlibpth='/usr/lib/386 /lib/386'
@@ -54,8 +54,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
: Private path used by Configure to find libraries. Its value
: is prepended to libpth. This variable takes care of special
-@@ -1391,8 +1377,6 @@
- libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
+@@ -1495,8 +1481,6 @@
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
: We probably want to search /usr/shlib before most other libraries.
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
@@ -63,7 +63,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
: Do not use vfork unless overridden by a hint file.
usevfork=false
-@@ -2446,7 +2430,6 @@
+@@ -2553,7 +2537,6 @@
zip
"
pth=`echo $PATH | sed -e "s/$p_/ /g"`
@@ -71,7 +71,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
for file in $loclist; do
eval xxx=\$$file
case "$xxx" in
-@@ -4936,7 +4919,7 @@
+@@ -5049,7 +5033,7 @@
: Set private lib path
case "$plibpth" in
'') if ./mips; then
@@ -80,7 +80,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
fi;;
esac
case "$libpth" in
-@@ -8600,13 +8583,8 @@
+@@ -8877,13 +8861,8 @@
echo " "
case "$sysman" in
'')
@@ -96,7 +96,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
;;
esac
if $test -d "$sysman"; then
-@@ -19900,9 +19878,10 @@
+@@ -21027,9 +21006,10 @@
case "$full_ar" in
'') full_ar=$ar ;;
esac
@@ -169,7 +169,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/
diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/linux.sh
--- perl-5.20.0-orig/hints/linux.sh 2014-05-26 15:34:20.000000000 +0200
+++ perl-5.20.0/hints/linux.sh 2014-06-25 10:33:47.354883843 +0200
-@@ -150,25 +150,6 @@
+@@ -150,28 +150,6 @@
;;
esac
@@ -188,6 +188,9 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
-# plibpth to bypass this check.
-if [ -x /usr/bin/gcc ] ; then
- gcc=/usr/bin/gcc
+-# clang also provides -print-search-dirs
+-elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
+- gcc=${cc:-cc}
-else
- gcc=gcc
-fi
@@ -195,7 +198,40 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
case "$plibpth" in
'') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
-@@ -367,33 +322,6 @@
+@@ -208,32 +186,6 @@
+ ;;
+ esac
+
+-case "$libc" in
+-'')
+-# If you have glibc, then report the version for ./myconfig bug reporting.
+-# (Configure doesn't need to know the specific version since it just uses
+-# gcc to load the library for all tests.)
+-# We don't use __GLIBC__ and __GLIBC_MINOR__ because they
+-# are insufficiently precise to distinguish things like
+-# libc-2.0.6 and libc-2.0.7.
+- for p in $plibpth
+- do
+- for trylib in libc.so.6 libc.so
+- do
+- if $test -e $p/$trylib; then
+- libc=`ls -l $p/$trylib | awk '{print $NF}'`
+- if $test "X$libc" != X; then
+- break
+- fi
+- fi
+- done
+- if $test "X$libc" != X; then
+- break
+- fi
+- done
+- ;;
+-esac
+-
+ if ${sh:-/bin/sh} -c exit; then
+ echo ''
+ echo 'You appear to have a working bash. Good.'
+@@ -311,33 +263,6 @@
;;
esac
@@ -229,40 +265,3 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
# Linux on Synology.
if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
# Tested on Synology DS213 and DS413
-diff --git a/hints/linux.sh b/hints/linux.sh
-index 3f38ea0..97aed11 100644
---- a/hints/linux.sh
-+++ b/hints/linux.sh
-@@ -195,32 +195,6 @@ case "$usequadmath" in
- ;;
- esac
-
--case "$libc" in
--'')
--# If you have glibc, then report the version for ./myconfig bug reporting.
--# (Configure doesn't need to know the specific version since it just uses
--# gcc to load the library for all tests.)
--# We don't use __GLIBC__ and __GLIBC_MINOR__ because they
--# are insufficiently precise to distinguish things like
--# libc-2.0.6 and libc-2.0.7.
-- for p in $plibpth
-- do
-- for trylib in libc.so.6 libc.so
-- do
-- if $test -e $p/$trylib; then
-- libc=`ls -l $p/$trylib | awk '{print $NF}'`
-- if $test "X$libc" != X; then
-- break
-- fi
-- fi
-- done
-- if $test "X$libc" != X; then
-- break
-- fi
-- done
-- ;;
--esac
--
- if ${sh:-/bin/sh} -c exit; then
- echo ''
- echo 'You appear to have a working bash. Good.'
diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch
index e13790bd41..b44e743c71 100644
--- a/gnu/packages/patches/python-3-fix-tests.patch
+++ b/gnu/packages/patches/python-3-fix-tests.patch
@@ -1,10 +1,39 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+---
+ Lib/ctypes/test/test_callbacks.py | 3 +++
+ Lib/ctypes/test/test_find.py | 1 +
+ Lib/ctypes/test/test_libc.py | 3 +++
+ Lib/distutils/tests/test_archive_util.py | 2 ++
+ Lib/distutils/tests/test_sdist.py | 1 +
+ Lib/test/_test_multiprocessing.py | 2 ++
+ Lib/test/test_asyncio/test_base_events.py | 2 ++
+ Lib/test/test_generators.py | 1 +
+ Lib/test/test_pathlib.py | 3 +--
+ Lib/test/test_pdb.py | 4 ++--
+ Lib/test/test_regrtest.py | 2 ++
+ Lib/test/test_resource.py | 1 +
+ Lib/test/test_shutil.py | 2 ++
+ Lib/test/test_signal.py | 4 ++++
+ Lib/test/test_socket.py | 8 ++++++++
+ Lib/test/test_spwd.py | 6 ++----
+ Lib/test/test_tarfile.py | 9 ++++++---
+ Lib/test/test_threading.py | 3 +++
+ Lib/test/test_unicodedata.py | 1 +
+ Tools/scripts/run_tests.py | 2 +-
+ 20 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
+index d8e9c5a760..94fc5929c9 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
+@@ -5,6 +5,7 @@ from test import support
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
@@ -12,7 +41,7 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
class Callbacks(unittest.TestCase):
functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
+@@ -178,6 +179,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
@@ -21,7 +50,20 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
def test_issue_8959_a(self):
from ctypes.util import find_library
libc_path = find_library("c")
+diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
+index 92ac1840ad..c8eb75dedd 100644
+--- a/Lib/ctypes/test/test_find.py
++++ b/Lib/ctypes/test/test_find.py
+@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+ self.assertNotEqual(find_library('c'), None)
+
++ @unittest.skipIf(True, "ldconfig is not used on Guix")
+ def test_find_library_with_ld(self):
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+ unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
+index 56285b5ff8..c088ab3db8 100644
--- a/Lib/ctypes/test/test_libc.py
+++ b/Lib/ctypes/test/test_libc.py
@@ -2,6 +2,7 @@ import unittest
@@ -42,6 +84,7 @@ diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
+index e9aad0e40f..8bbaa51ee5 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
@@ -61,6 +104,7 @@ diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test
tmpdir = self._create_files()
base_name = os.path.join(self.mkdtemp(), 'archive')
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
+index 23db126959..6e2329df7d 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
@@ -72,9 +116,10 @@ diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.
# now building a sdist
dist, cmd = self.get_cmd()
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e47905c863..31a5a9c308 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
+@@ -1577,6 +1577,7 @@ class _TestCondition(BaseTestCase):
if pid is not None:
os.kill(pid, signal.SIGINT)
@@ -82,10 +127,19 @@ diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.
def test_wait_result(self):
if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
pid = os.getpid()
+@@ -3905,6 +3906,7 @@ class _TestSharedMemory(BaseTestCase):
+ sms.close()
+
+ @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+ def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+ # bpo-36368: protect SharedMemoryManager server process from
+ # KeyboardInterrupt signals.
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 533d5cc7f5..c4f860cc3b 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+@@ -1341,6 +1341,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self._test_create_connection_ip_addr(m_socket, False)
@patch_socket
@@ -95,9 +149,10 @@ diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/t
m_socket.getaddrinfo = socket.getaddrinfo
sock = m_socket.socket.return_value
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 3bf1522808..04bac8a7db 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
+@@ -33,6 +33,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
else:
return "FAILED"
@@ -105,30 +160,11 @@ diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
def test_raise_and_yield_from(self):
gen = self.generator1()
gen.send(None)
-diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
---- a/Lib/test/test_normalization.py
-+++ b/Lib/test/test_normalization.py
-@@ -2,6 +2,7 @@ from test.support import open_urlresource
- import unittest
-
- from http.client import HTTPException
-+from urllib.error import URLError
- import sys
- from unicodedata import normalize, unidata_version
-
-@@ -43,6 +44,8 @@ class NormalizationTest(unittest.TestCase):
- except PermissionError:
- self.skipTest(f"Permission error when downloading {TESTDATAURL} "
- f"into the test data directory")
-+ except URLError:
-+ self.skipTest("DNS lookups are not enabled.")
- except (OSError, HTTPException):
- self.fail(f"Could not retrieve {TESTDATAURL}")
-
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index 3da35710b9..5404f9193d 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
+@@ -2408,8 +2408,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
self.assertEqual(given, expect)
self.assertEqual(set(p.rglob("FILEd*")), set())
@@ -139,9 +175,10 @@ diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
P = self.cls
support.import_module('pwd')
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 8016f81e5a..10190486b4 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
+@@ -1219,11 +1219,11 @@ def test_pdb_issue_20766():
> <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
-> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
(Pdb) continue
@@ -156,9 +193,10 @@ diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index a77638b10a..2069b349a8 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -811,6 +811,7 @@ class ArgsTestCase(BaseTestCase):
output = self.run_tests('--fromfile', filename)
self.check_executed_tests(output, tests)
@@ -166,7 +204,7 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
def test_interrupted(self):
code = TEST_INTERRUPTED
test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -828,6 +829,7 @@ class ArgsTestCase(BaseTestCase):
% (self.TESTNAME_REGEX, len(tests)))
self.check_line(output, regex)
@@ -175,9 +213,10 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
# Issue #25373: test --slowest with an interrupted test
code = TEST_INTERRUPTED
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index e5ece5284c..5299e54507 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
+@@ -148,6 +148,7 @@ class ResourceTest(unittest.TestCase):
@unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
@support.requires_linux_version(2, 6, 36)
@@ -186,37 +225,75 @@ diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
self.assertRaises(TypeError, resource.prlimit)
self.assertRaises(ProcessLookupError, resource.prlimit,
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index e19af64be0..1b893df6fa 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
-@@ -1143,6 +1143,7 @@ class TestShutil(unittest.TestCase):
+@@ -1427,6 +1427,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+ base_name = os.path.join(tmpdir, 'archive')
self.assertRaises(ValueError, make_archive, base_name, 'xxx')
- @support.requires_zlib
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++ @unittest.skipIf(True, "The Guix build container has no root user")
+ @support.requires_zlib()
def test_make_archive_owner_group(self):
# testing make_archive with owner and group, with various combinations
- # this works even if there's not gid/uid support
-@@ -1171,6 +1172,7 @@ class TestShutil(unittest.TestCase):
+@@ -1455,6 +1456,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+ self.assertTrue(os.path.isfile(res))
- @support.requires_zlib
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++ @unittest.skipIf(True, "The Guix build container has no root user")
+ @support.requires_zlib()
@unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
def test_tarfile_root_owner(self):
- root_dir, base_dir = self._create_files()
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 45553a6a42..55623f01a3 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
+ self.assertLess(len(s), signal.NSIG)
+
+ @unittest.skipUnless(sys.executable, "sys.executable required.")
++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+ def test_keyboard_interrupt_exit_code(self):
+ """KeyboardInterrupt triggers exit via SIGINT."""
+ process = subprocess.run(
+@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
+ signal.signal(7, handler)
+
+ @unittest.skipUnless(sys.executable, "sys.executable required.")
++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+ def test_keyboard_interrupt_exit_code(self):
+ """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+ # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
+@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
+
+ class RaiseSignalTest(unittest.TestCase):
+
++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+ def test_sigint(self):
+ with self.assertRaises(KeyboardInterrupt):
+ signal.raise_signal(signal.SIGINT)
+@@ -1275,6 +1278,7 @@ class RaiseSignalTest(unittest.TestCase):
+
+ class PidfdSignalTest(unittest.TestCase):
+
++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+ @unittest.skipUnless(
+ hasattr(signal, "pidfd_send_signal"),
+ "pidfd support not built in",
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index aefba4f397..6c89f558d5 100755
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
-@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1009,6 +1009,8 @@ class GeneralModuleTests(unittest.TestCase):
if not fqhn in all_host_names:
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
+ @unittest.skipUnless(support.is_resource_enabled('network'),
+ 'network is not enabled')
def test_host_resolution(self):
- for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
+ for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1140,6 +1142,8 @@ class GeneralModuleTests(unittest.TestCase):
self.assertWarns(DeprecationWarning, socket.ntohs, k)
self.assertWarns(DeprecationWarning, socket.htons, k)
@@ -225,7 +302,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
def testGetServBy(self):
eq = self.assertEqual
# Find one service that exists, then check all the related interfaces.
-@@ -1358,6 +1362,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1489,6 +1493,8 @@ class GeneralModuleTests(unittest.TestCase):
raise
self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
@@ -234,7 +311,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
def testGetaddrinfo(self):
try:
socket.getaddrinfo('localhost', 80)
-@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1571,6 +1577,8 @@ class GeneralModuleTests(unittest.TestCase):
# only IP addresses are allowed
self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
@@ -244,6 +321,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
'network is not enabled')
def test_idna(self):
diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 07793c84c8..fec672bcbe 100644
--- a/Lib/test/test_spwd.py
+++ b/Lib/test/test_spwd.py
@@ -5,8 +5,7 @@ from test import support
@@ -267,9 +345,10 @@ diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
def test_getspnam_exception(self):
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 29cde91bf7..8d0f20e8bf 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
+@@ -2607,9 +2607,12 @@ def root_is_uid_gid_0():
import pwd, grp
except ImportError:
return False
@@ -286,9 +365,10 @@ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
return True
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index c21cdf8eb7..6c9d575032 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
+@@ -1398,6 +1398,7 @@ class MiscTestCase(unittest.TestCase):
class InterruptMainTests(unittest.TestCase):
@@ -296,7 +376,7 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
def test_interrupt_main_subthread(self):
# Calling start_new_thread with a function that executes interrupt_main
# should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
+@@ -1409,6 +1410,8 @@ class InterruptMainTests(unittest.TestCase):
t.join()
t.join()
@@ -305,10 +385,23 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
def test_interrupt_main_mainthread(self):
# Make sure that if interrupt_main is called in main thread that
# KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index b552d2bd17..28b1144e15 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -309,6 +309,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
+ self.assertEqual(len(lines), 1,
+ r"\u%.4x should not be a linebreak" % i)
+
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+ @staticmethod
+ def check_version(testfile):
diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index bcfa5e943b..1f2484971b 100644
--- a/Tools/scripts/run_tests.py
+++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
+@@ -41,7 +41,7 @@ def main(regrtest_args):
if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
args.extend(['-j', '0']) # Use all CPU cores
if not any(is_resource_use_flag(arg) for arg in regrtest_args):
@@ -317,3 +410,6 @@ diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
args.extend(regrtest_args)
print(' '.join(args))
if sys.platform == 'win32':
+--
+2.29.2
+
diff --git a/gnu/packages/patches/python-3-hurd-configure.patch b/gnu/packages/patches/python-3-hurd-configure.patch
new file mode 100644
index 0000000000..aa25a401c5
--- /dev/null
+++ b/gnu/packages/patches/python-3-hurd-configure.patch
@@ -0,0 +1,27 @@
+Upstream status: Not upstreamed.
+
+The build system refuses to cross-compile for unknown targets
+even though it works fine. Add GNU/Hurd target.
+
+--- Python-3.8.5/configure.orig 2020-10-26 14:06:09.665423525 +0100
++++ Python-3.8.5/configure 2020-10-26 14:08:30.987765738 +0100
+@@ -3278,6 +3278,9 @@
+ *-*-vxworks*)
+ ac_sys_system=VxWorks
+ ;;
++ *-*-gnu)
++ ac_sys_system=GNU
++ ;;
+ *)
+ # for now, limit cross builds to known configurations
+ MACHDEP="unknown"
+@@ -3328,6 +3331,9 @@
+ *-*-vxworks*)
+ _host_cpu=$host_cpu
+ ;;
++ *-*-gnu)
++ _host_cpu=$host_cpu
++ ;;
+ *)
+ # for now, limit cross builds to known configurations
+ MACHDEP="unknown"
diff --git a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch b/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
deleted file mode 100644
index 01f6b52865..0000000000
--- a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-Fix CVE-2021-3177 for Python 3.8:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177
-
-Patch copied from upstream source repository:
-
-https://github.com/python/cpython/commit/ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f
-
-From ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f Mon Sep 17 00:00:00 2001
-From: "Miss Islington (bot)"
- <31488909+miss-islington@users.noreply.github.com>
-Date: Mon, 18 Jan 2021 13:28:52 -0800
-Subject: [PATCH] closes bpo-42938: Replace snprintf with Python unicode
- formatting in ctypes param reprs. (GH-24248)
-
-(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7)
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
----
- Lib/ctypes/test/test_parameters.py | 43 ++++++++++++++++
- .../2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst | 2 +
- Modules/_ctypes/callproc.c | 51 +++++++------------
- 3 files changed, 64 insertions(+), 32 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-
-diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
-index e4c25fd880cef..531894fdec838 100644
---- a/Lib/ctypes/test/test_parameters.py
-+++ b/Lib/ctypes/test/test_parameters.py
-@@ -201,6 +201,49 @@ def __dict__(self):
- with self.assertRaises(ZeroDivisionError):
- WorseStruct().__setstate__({}, b'foo')
-
-+ def test_parameter_repr(self):
-+ from ctypes import (
-+ c_bool,
-+ c_char,
-+ c_wchar,
-+ c_byte,
-+ c_ubyte,
-+ c_short,
-+ c_ushort,
-+ c_int,
-+ c_uint,
-+ c_long,
-+ c_ulong,
-+ c_longlong,
-+ c_ulonglong,
-+ c_float,
-+ c_double,
-+ c_longdouble,
-+ c_char_p,
-+ c_wchar_p,
-+ c_void_p,
-+ )
-+ self.assertRegex(repr(c_bool.from_param(True)), r"^<cparam '\?' at 0x[A-Fa-f0-9]+>$")
-+ self.assertEqual(repr(c_char.from_param(97)), "<cparam 'c' ('a')>")
-+ self.assertRegex(repr(c_wchar.from_param('a')), r"^<cparam 'u' at 0x[A-Fa-f0-9]+>$")
-+ self.assertEqual(repr(c_byte.from_param(98)), "<cparam 'b' (98)>")
-+ self.assertEqual(repr(c_ubyte.from_param(98)), "<cparam 'B' (98)>")
-+ self.assertEqual(repr(c_short.from_param(511)), "<cparam 'h' (511)>")
-+ self.assertEqual(repr(c_ushort.from_param(511)), "<cparam 'H' (511)>")
-+ self.assertRegex(repr(c_int.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+ self.assertRegex(repr(c_uint.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+ self.assertRegex(repr(c_long.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+ self.assertRegex(repr(c_ulong.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+ self.assertRegex(repr(c_longlong.from_param(20000)), r"^<cparam '[liq]' \(20000\)>$")
-+ self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$")
-+ self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>")
-+ self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>")
-+ self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>")
-+ self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$")
-+ self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$")
-+ self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$")
-+ self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$")
-+
- ################################################################
-
- if __name__ == '__main__':
-#diff --git a/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#new file mode 100644
-#index 0000000000000..7df65a156feab
-#--- /dev/null
-#+++ b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#@@ -0,0 +1,2 @@
-#+Avoid static buffers when computing the repr of :class:`ctypes.c_double` and
-#+:class:`ctypes.c_longdouble` values.
-diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
-index a9b8675cd951b..de75918d49f37 100644
---- a/Modules/_ctypes/callproc.c
-+++ b/Modules/_ctypes/callproc.c
-@@ -484,58 +484,47 @@ is_literal_char(unsigned char c)
- static PyObject *
- PyCArg_repr(PyCArgObject *self)
- {
-- char buffer[256];
- switch(self->tag) {
- case 'b':
- case 'B':
-- sprintf(buffer, "<cparam '%c' (%d)>",
-+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.b);
-- break;
- case 'h':
- case 'H':
-- sprintf(buffer, "<cparam '%c' (%d)>",
-+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.h);
-- break;
- case 'i':
- case 'I':
-- sprintf(buffer, "<cparam '%c' (%d)>",
-+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.i);
-- break;
- case 'l':
- case 'L':
-- sprintf(buffer, "<cparam '%c' (%ld)>",
-+ return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
- self->tag, self->value.l);
-- break;
-
- case 'q':
- case 'Q':
-- sprintf(buffer,
--#ifdef MS_WIN32
-- "<cparam '%c' (%I64d)>",
--#else
-- "<cparam '%c' (%lld)>",
--#endif
-+ return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
- self->tag, self->value.q);
-- break;
- case 'd':
-- sprintf(buffer, "<cparam '%c' (%f)>",
-- self->tag, self->value.d);
-- break;
-- case 'f':
-- sprintf(buffer, "<cparam '%c' (%f)>",
-- self->tag, self->value.f);
-- break;
--
-+ case 'f': {
-+ PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
-+ if (f == NULL) {
-+ return NULL;
-+ }
-+ PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
-+ Py_DECREF(f);
-+ return result;
-+ }
- case 'c':
- if (is_literal_char((unsigned char)self->value.c)) {
-- sprintf(buffer, "<cparam '%c' ('%c')>",
-+ return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
- self->tag, self->value.c);
- }
- else {
-- sprintf(buffer, "<cparam '%c' ('\\x%02x')>",
-+ return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
- self->tag, (unsigned char)self->value.c);
- }
-- break;
-
- /* Hm, are these 'z' and 'Z' codes useful at all?
- Shouldn't they be replaced by the functionality of c_string
-@@ -544,22 +533,20 @@ PyCArg_repr(PyCArgObject *self)
- case 'z':
- case 'Z':
- case 'P':
-- sprintf(buffer, "<cparam '%c' (%p)>",
-+ return PyUnicode_FromFormat("<cparam '%c' (%p)>",
- self->tag, self->value.p);
- break;
-
- default:
- if (is_literal_char((unsigned char)self->tag)) {
-- sprintf(buffer, "<cparam '%c' at %p>",
-+ return PyUnicode_FromFormat("<cparam '%c' at %p>",
- (unsigned char)self->tag, (void *)self);
- }
- else {
-- sprintf(buffer, "<cparam 0x%02x at %p>",
-+ return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
- (unsigned char)self->tag, (void *)self);
- }
-- break;
- }
-- return PyUnicode_FromString(buffer);
- }
-
- static PyMemberDef PyCArgType_members[] = {
diff --git a/gnu/packages/patches/python-3.8-fix-tests.patch b/gnu/packages/patches/python-3.8-fix-tests.patch
deleted file mode 100644
index 4fbdd444c7..0000000000
--- a/gnu/packages/patches/python-3.8-fix-tests.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
- sms.close()
-
- @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
- # bpo-36368: protect SharedMemoryManager server process from
- # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
- self.assertLess(len(s), signal.NSIG)
-
- @unittest.skipUnless(sys.executable, "sys.executable required.")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_keyboard_interrupt_exit_code(self):
- """KeyboardInterrupt triggers exit via SIGINT."""
- process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
- signal.signal(7, handler)
-
- @unittest.skipUnless(sys.executable, "sys.executable required.")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_keyboard_interrupt_exit_code(self):
- """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
- # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_sigint(self):
- with self.assertRaises(KeyboardInterrupt):
- signal.raise_signal(signal.SIGINT)
---
-2.23.0
diff --git a/gnu/packages/patches/python-3.9-fix-tests.patch b/gnu/packages/patches/python-3.9-fix-tests.patch
deleted file mode 100644
index dc6b8c4cc8..0000000000
--- a/gnu/packages/patches/python-3.9-fix-tests.patch
+++ /dev/null
@@ -1,370 +0,0 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
-
-diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
---- a/Lib/ctypes/test/test_callbacks.py
-+++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
- from ctypes import *
- from ctypes.test import need_symbol
- import _ctypes_test
-+import platform
-
- class Callbacks(unittest.TestCase):
- functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
-
- self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
-
-+ @unittest.skipIf(platform.machine() in ['mips64'],
-+ "This test fails on this platform")
- def test_issue_8959_a(self):
- from ctypes.util import find_library
- libc_path = find_library("c")
-diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
---- a/Lib/ctypes/test/test_libc.py
-+++ b/Lib/ctypes/test/test_libc.py
-@@ -2,6 +2,7 @@ import unittest
-
- from ctypes import *
- import _ctypes_test
-+import platform
-
- lib = CDLL(_ctypes_test.__file__)
-
-@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase):
- import math
- self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
-
-+ @unittest.skipIf(platform.machine() in ['mips64'],
-+ "This test fails on this platform")
- def test_qsort(self):
- comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
- lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
-diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
---- a/Lib/distutils/tests/test_archive_util.py
-+++ b/Lib/distutils/tests/test_archive_util.py
-@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
- self.assertEqual(os.path.basename(res), 'archive.tar.xz')
- self.assertEqual(self._tarinfo(res), self._created_files)
-
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- def test_make_archive_owner_group(self):
- # testing make_archive with owner and group, with various combinations
- # this works even if there's not gid/uid support
-@@ -362,6 +363,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
-
- @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
- @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- def test_tarfile_root_owner(self):
- tmpdir = self._create_files()
- base_name = os.path.join(self.mkdtemp(), 'archive')
-diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
---- a/Lib/distutils/tests/test_sdist.py
-+++ b/Lib/distutils/tests/test_sdist.py
-@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
- "The tar command is not found")
- @unittest.skipIf(find_executable('gzip') is None,
- "The gzip command is not found")
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- def test_make_distribution_owner_group(self):
- # now building a sdist
- dist, cmd = self.get_cmd()
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
- if pid is not None:
- os.kill(pid, signal.SIGINT)
-
-+ @unittest.skipIf(True, "This fails for unknown reasons on Guix")
- def test_wait_result(self):
- if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
- pid = os.getpid()
-diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
---- a/Lib/test/test_asyncio/test_base_events.py
-+++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
- self._test_create_connection_ip_addr(m_socket, False)
-
- @patch_socket
-+ @unittest.skipUnless(support.is_resource_enabled('network'),
-+ 'network is not enabled')
- def test_create_connection_service_name(self, m_socket):
- m_socket.getaddrinfo = socket.getaddrinfo
- sock = m_socket.socket.return_value
-diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
---- a/Lib/test/test_generators.py
-+++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
- else:
- return "FAILED"
-
-+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
- def test_raise_and_yield_from(self):
- gen = self.generator1()
- gen.send(None)
-diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
---- a/Lib/test/test_pathlib.py
-+++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
- self.assertEqual(given, expect)
- self.assertEqual(set(p.rglob("FILEd*")), set())
-
-- @unittest.skipUnless(hasattr(pwd, 'getpwall'),
-- 'pwd module does not expose getpwall()')
-+ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
- def test_expanduser(self):
- P = self.cls
- support.import_module('pwd')
-diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
---- a/Lib/test/test_pdb.py
-+++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
- > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
- -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
- (Pdb) continue
-- pdb 1: <built-in function default_int_handler>
-+ pdb 1: Handlers.SIG_IGN
- > <doctest test.test_pdb.test_pdb_issue_20766[0]>(5)test_function()
- -> sess.set_trace(sys._getframe())
- (Pdb) continue
-- pdb 2: <built-in function default_int_handler>
-+ pdb 2: Handlers.SIG_IGN
- """
-
-
-diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
---- a/Lib/test/test_regrtest.py
-+++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
- output = self.run_tests('--fromfile', filename)
- self.check_executed_tests(output, tests)
-
-+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
- def test_interrupted(self):
- code = TEST_INTERRUPTED
- test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
- % (self.TESTNAME_REGEX, len(tests)))
- self.check_line(output, regex)
-
-+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
- def test_slowest_interrupted(self):
- # Issue #25373: test --slowest with an interrupted test
- code = TEST_INTERRUPTED
-diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
---- a/Lib/test/test_resource.py
-+++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
-
- @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
- @support.requires_linux_version(2, 6, 36)
-+ @unittest.skipIf(True, "Bug: the PermissionError is not raised")
- def test_prlimit(self):
- self.assertRaises(TypeError, resource.prlimit)
- self.assertRaises(ProcessLookupError, resource.prlimit,
-diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
---- a/Lib/test/test_shutil.py
-+++ b/Lib/test/test_shutil.py
-@@ -1428,6 +1428,7 @@ class TestArchives(BaseTest, unittest.TestCase):
- self.assertRaises(ValueError, make_archive, base_name, 'xxx')
-
- @support.requires_zlib()
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- def test_make_archive_owner_group(self):
- # testing make_archive with owner and group, with various combinations
- # this works even if there's not gid/uid support
-@@ -1456,6 +1457,7 @@ class TestArchives(BaseTest, unittest.TestCase):
-
-
- @support.requires_zlib()
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
- def test_tarfile_root_owner(self):
- root_dir, base_dir = self._create_files()
-diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
---- a/Lib/test/test_unicodedata.py
-+++ b/Lib/test/test_unicodedata.py
-@@ -320,6 +320,7 @@ class NormalizationTest(unittest.TestCase):
- data = [int(x, 16) for x in data.split(" ")]
- return "".join([chr(x) for x in data])
-
-+ @unittest.skipIf(True, 'Network is not available in the Guix build environment')
- def test_normalization(self):
- TESTDATAFILE = "NormalizationTest.txt"
- TESTDATAURL = f"http://www.pythontest.net/unicode/{unicodedata.unidata_version}/{TESTDATAFILE}"
-diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
---- a/Lib/test/test_socket.py
-+++ b/Lib/test/test_socket.py
-@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
- if not fqhn in all_host_names:
- self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
-
-+ @unittest.skipUnless(support.is_resource_enabled('network'),
-+ 'network is not enabled')
- def test_host_resolution(self):
- for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
- self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
- self.assertWarns(DeprecationWarning, socket.ntohs, k)
- self.assertWarns(DeprecationWarning, socket.htons, k)
-
-+ @unittest.skipUnless(os.path.exists("/etc/services"),
-+ "getservbyname uses /etc/services, which is not in the chroot")
- def testGetServBy(self):
- eq = self.assertEqual
- # Find one service that exists, then check all the related interfaces.
-@@ -1358,6 +1362,8 @@ class GeneralModuleTests(unittest.TestCase):
- raise
- self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
-
-+ @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+ "getaddrinfo() will fail")
- def testGetaddrinfo(self):
- try:
- socket.getaddrinfo('localhost', 80)
-@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
- # only IP addresses are allowed
- self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
-
-+ @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+ "getaddrinfo() will fail")
- @unittest.skipUnless(support.is_resource_enabled('network'),
- 'network is not enabled')
- def test_idna(self):
-diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
---- a/Lib/test/test_spwd.py
-+++ b/Lib/test/test_spwd.py
-@@ -5,8 +5,7 @@ from test import support
- spwd = support.import_module('spwd')
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
-- 'root privileges required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdRoot(unittest.TestCase):
-
- def test_getspall(self):
-@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase):
- self.assertRaises(TypeError, spwd.getspnam, bytes_name)
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
-- 'non-root user required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdNonRoot(unittest.TestCase):
-
- def test_getspnam_exception(self):
-diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
---- a/Lib/test/test_tarfile.py
-+++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
- import pwd, grp
- except ImportError:
- return False
-- if pwd.getpwuid(0)[0] != 'root':
-- return False
-- if grp.getgrgid(0)[0] != 'root':
-+ try:
-+ if pwd.getpwuid(0)[0] != 'root':
-+ return False
-+ if grp.getgrgid(0)[0] != 'root':
-+ return False
-+ except KeyError:
- return False
- return True
-
-diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
---- a/Lib/test/test_threading.py
-+++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
-
-
- class InterruptMainTests(unittest.TestCase):
-+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
- def test_interrupt_main_subthread(self):
- # Calling start_new_thread with a function that executes interrupt_main
- # should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
- t.join()
- t.join()
-
-+
-+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
- def test_interrupt_main_mainthread(self):
- # Make sure that if interrupt_main is called in main thread that
- # KeyboardInterrupt is raised instantly.
-diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
---- a/Tools/scripts/run_tests.py
-+++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
- if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
- args.extend(['-j', '0']) # Use all CPU cores
- if not any(is_resource_use_flag(arg) for arg in regrtest_args):
-- args.extend(['-u', 'all,-largefile,-audio,-gui'])
-+ args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
- args.extend(regrtest_args)
- print(' '.join(args))
- if sys.platform == 'win32':
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
- sms.close()
-
- @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
- # bpo-36368: protect SharedMemoryManager server process from
- # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
- self.assertLess(len(s), signal.NSIG)
-
- @unittest.skipUnless(sys.executable, "sys.executable required.")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_keyboard_interrupt_exit_code(self):
- """KeyboardInterrupt triggers exit via SIGINT."""
- process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
- signal.signal(7, handler)
-
- @unittest.skipUnless(sys.executable, "sys.executable required.")
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_keyboard_interrupt_exit_code(self):
- """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
- # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_sigint(self):
- with self.assertRaises(KeyboardInterrupt):
- signal.raise_signal(signal.SIGINT)
-@@ -1279,6 +1279,7 @@ class PidfdSignalTest(unittest.TestCase):
- hasattr(signal, "pidfd_send_signal"),
- "pidfd support not built in",
- )
-+ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
- def test_pidfd_send_signal(self):
- with self.assertRaises(OSError) as cm:
- signal.pidfd_send_signal(0, signal.SIGINT)
-diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
-index 92ac184..49eec2c 100644
---- a/Lib/ctypes/test/test_find.py
-+++ b/Lib/ctypes/test/test_find.py
-@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
- with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
- self.assertNotEqual(find_library('c'), None)
-
-+ @unittest.skipIf(True, "This fails for unknown reasons on Guix")
- def test_find_library_with_ld(self):
- with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
- unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
diff --git a/gnu/packages/patches/python-babel-fix-parse-future-test.patch b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
new file mode 100644
index 0000000000..8a90166ec5
--- /dev/null
+++ b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
@@ -0,0 +1,68 @@
+From 7bdaa28a55e8d8228d5434effa4b1473ab7b3669 Mon Sep 17 00:00:00 2001
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+Date: Tue, 5 May 2020 08:05:56 +0000
+Subject: [PATCH] fix tests when using Python 3.9a6
+
+In Python 3.9a6 integer values for future flags were changed to prevent
+collision with compiler flags. We need to retrieve these at runtime so
+the test suite works with Python <= 3.8 as well as Python 3.9.
+---
+ tests/test_util.py | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index a6a4450c..b9343aaa 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -11,6 +11,7 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://babel.edgewall.org/log/.
+
++import __future__
+ import unittest
+
+ import pytest
+@@ -20,6 +21,12 @@
+ from babel.util import parse_future_flags
+
+
++class _FF:
++ division = __future__.division.compiler_flag
++ print_function = __future__.print_function.compiler_flag
++ with_statement = __future__.with_statement.compiler_flag
++ unicode_literals = __future__.unicode_literals.compiler_flag
++
+ def test_distinct():
+ assert list(util.distinct([1, 2, 1, 3, 4, 4])) == [1, 2, 3, 4]
+ assert list(util.distinct('foobar')) == ['f', 'o', 'b', 'a', 'r']
+@@ -70,25 +77,25 @@ def test_parse_encoding_non_ascii():
+ from __future__ import print_function,
+ division, with_statement,
+ unicode_literals
+-''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
++''', _FF.print_function | _FF.division | _FF.with_statement | _FF.unicode_literals),
+ ('''
+ from __future__ import print_function, division
+ print('hello')
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import print_function, division, unknown,,,,,
+ print 'hello'
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import (
+ print_function,
+ division)
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import \\
+ print_function, \\
+ division
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ])
+ def test_parse_future(source, result):
+ fp = BytesIO(source.encode('latin-1'))
diff --git a/gnu/packages/patches/python-libxml2-python39-compat.patch b/gnu/packages/patches/python-libxml2-python39-compat.patch
new file mode 100644
index 0000000000..a707ea3434
--- /dev/null
+++ b/gnu/packages/patches/python-libxml2-python39-compat.patch
@@ -0,0 +1,94 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/e4fb36841800038c289997432ca547c9bfef9db1.patch
+
+From e4fb36841800038c289997432ca547c9bfef9db1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Fri, 28 Feb 2020 12:48:14 +0100
+Subject: [PATCH] Parenthesize Py<type>_Check() in ifs
+
+In C, if expressions should be parenthesized.
+PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
+expression before, but that's not API to rely on.
+
+Since Python 3.9.0a4 it needs to be parenthesized explicitly.
+
+Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
+---
+ python/libxml.c | 4 ++--
+ python/types.c | 12 ++++++------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/python/libxml.c b/python/libxml.c
+index bc676c4e..81e709f3 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
+ lenread = PyBytes_Size(ret);
+ data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+- } else if PyUnicode_Check (ret) {
++ } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+ Py_ssize_t size;
+ const char *tmp;
+@@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
+ lenread = PyBytes_Size(ret);
+ data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+- } else if PyUnicode_Check (ret) {
++ } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+ Py_ssize_t size;
+ const char *tmp;
+diff --git a/python/types.c b/python/types.c
+index c2bafeb1..ed284ec7 100644
+--- a/python/types.c
++++ b/python/types.c
+@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+ if (obj == NULL) {
+ return (NULL);
+ }
+- if PyFloat_Check (obj) {
++ if (PyFloat_Check (obj)) {
+ ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
+- } else if PyLong_Check(obj) {
++ } else if (PyLong_Check(obj)) {
+ #ifdef PyLong_AS_LONG
+ ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
+ #else
+ ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
+ #endif
+ #ifdef PyBool_Check
+- } else if PyBool_Check (obj) {
++ } else if (PyBool_Check (obj)) {
+
+ if (obj == Py_True) {
+ ret = xmlXPathNewBoolean(1);
+@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+ ret = xmlXPathNewBoolean(0);
+ }
+ #endif
+- } else if PyBytes_Check (obj) {
++ } else if (PyBytes_Check (obj)) {
+ xmlChar *str;
+
+ str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
+ PyBytes_GET_SIZE(obj));
+ ret = xmlXPathWrapString(str);
+ #ifdef PyUnicode_Check
+- } else if PyUnicode_Check (obj) {
++ } else if (PyUnicode_Check (obj)) {
+ #if PY_VERSION_HEX >= 0x03030000
+ xmlChar *str;
+ const char *tmp;
+@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+ ret = xmlXPathWrapString(str);
+ #endif
+ #endif
+- } else if PyList_Check (obj) {
++ } else if (PyList_Check (obj)) {
+ int i;
+ PyObject *node;
+ xmlNodePtr cur;
+--
+GitLab
+
diff --git a/gnu/packages/patches/python-typing-inspect-fix.patch b/gnu/packages/patches/python-typing-inspect-fix.patch
new file mode 100644
index 0000000000..e6e28981b7
--- /dev/null
+++ b/gnu/packages/patches/python-typing-inspect-fix.patch
@@ -0,0 +1,38 @@
+From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Fri, 15 Jan 2021 09:22:52 -0500
+Subject: [PATCH] Fix for Python 3.9+.
+
+Fixes <https://github.com/ilevkivskyi/typing_inspect/issues/60>.
+
+Based on an idea in
+https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584.
+---
+ typing_inspect.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/typing_inspect.py b/typing_inspect.py
+index 1ca68ed..31d05ee 100644
+--- a/typing_inspect.py
++++ b/typing_inspect.py
+@@ -21,7 +21,7 @@ LEGACY_TYPING = False
+
+ if NEW_TYPING:
+ from typing import (
+- Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef
++ Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef
+ )
+ from typing_extensions import Literal
+ else:
+@@ -75,7 +75,7 @@ def is_generic_type(tp):
+ """
+ if NEW_TYPING:
+ return (isinstance(tp, type) and issubclass(tp, Generic) or
+- isinstance(tp, _GenericAlias) and
++ (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and
+ tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable))
+ return (isinstance(tp, GenericMeta) and not
+ isinstance(tp, (CallableMeta, TupleMeta)))
+--
+2.29.2
+
diff --git a/gnu/packages/patches/rust-1.19-mrustc.patch b/gnu/packages/patches/rust-1.19-mrustc.patch
deleted file mode 100644
index 261162172e..0000000000
--- a/gnu/packages/patches/rust-1.19-mrustc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-See https://github.com/thepowersgang/mrustc/archive/v0.8.0.tar.gz
-
---- rustc-1.19.0-src-orig/src/libcore/intrinsics.rs
-+++ rustc-1.19.0-src/src/libcore/intrinsics.rs
-@@ -678,5 +678,9 @@
- pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
-
-+ /// Obtain the length of a slice pointer
-+ #[cfg(rust_compiler="mrustc")]
-+ pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
-+
- /// Gets a static string slice containing the name of a type.
- pub fn type_name<T: ?Sized>() -> &'static str;
-
---- rustc-1.19.0-src-orig/src/libcore/slice/mod.rs
-+++ rustc-1.19.0-src/src/libcore/slice/mod.rs
-@@ -413,6 +413,8 @@
- #[inline]
- fn len(&self) -> usize {
-- unsafe {
-- mem::transmute::<&[T], Repr<T>>(self).len
-- }
-+ #[cfg(not(rust_compiler="mrustc"))]
-+ let rv = unsafe { mem::transmute::<&[T], Repr<T>>(self).len };
-+ #[cfg(rust_compiler="mrustc")]
-+ let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
-+ rv
- }
diff --git a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
deleted file mode 100644
index a2bad55117..0000000000
--- a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-GDB responds with some overly detailed lines - which makes the tests fail.
-Patch rust to accept those instead.
-See <https://github.com/rust-lang/rust/issues/54178>.
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:25:56.322513658 +0200
-@@ -19,36 +19,36 @@
-
- // gdb-command:print eight_bytes1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}}
--// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100)
-+// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)
-
- // gdb-command:print four_bytes1
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}}
--// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101)
-+// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)
-
- // gdb-command:print two_bytes1
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}}
--// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102)
-+// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)
-
- // gdb-command:print one_byte1
- // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}}
--// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65)
-+// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)
-
-
- // gdb-command:print eight_bytes2
- // gdbg-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}}
--// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100)
-+// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)
-
- // gdb-command:print four_bytes2
- // gdbg-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}}
--// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101)
-+// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)
-
- // gdb-command:print two_bytes2
- // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}}
--// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102)
-+// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)
-
- // gdb-command:print one_byte2
- // gdbg-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}}
--// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65)
-+// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)
-
- // gdb-command:continue
-
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs 2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs 2018-09-13 10:27:43.353108111 +0200
-@@ -19,15 +19,15 @@
-
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
-+// gdbr-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
-
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153}
-+// gdbr-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153}
-
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
--// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897}
-+// gdbr-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897}
-
- // gdb-command:print univariant
- // gdbg-check:$4 = {{a = -1}}
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs 2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs 2018-09-13 10:28:26.328546298 +0200
-@@ -21,15 +21,15 @@
-
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868)
-+// gdbr-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868)
-
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153)
-+// gdbr-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153)
-
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
--// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897)
-+// gdbr-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897)
-
- // gdb-command:print univariant
- // gdbg-check:$4 = {{__0 = -1}}
---- orig/rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs 2018-09-13 10:24:33.783565071 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs 2018-10-26 18:19:20.404564587 +0200
-@@ -17,11 +17,11 @@
-
- // gdb-command:print first
- // gdbg-check:$1 = {<No data fields>}
--// gdbr-check:$1 = <error reading variable>
-+// gdbr-check:$1 = nil_enum::ANilEnum
-
- // gdb-command:print second
- // gdbg-check:$2 = {<No data fields>}
--// gdbr-check:$2 = <error reading variable>
-+// gdbr-check:$2 = nil_enum::AnotherNilEnum
-
- #![allow(unused_variables)]
- #![feature(omit_gdb_pretty_printer_section)]
diff --git a/gnu/packages/patches/rust-1.30-gdb-llvm.patch b/gnu/packages/patches/rust-1.30-gdb-llvm.patch
deleted file mode 100644
index e8f0acc8b4..0000000000
--- a/gnu/packages/patches/rust-1.30-gdb-llvm.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Tweak some gdb tests which were broken during LLVM upgrades.
-This has been subsequently fixed upstream in later rustc versions,
-but still needed to bootstrap some earlier versions of the compiler.
-
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs 2019-02-04 12:49:34.055483896 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs 2019-02-04 13:01:10.915950356 -0800
-@@ -18,15 +18,15 @@
-
- // gdb-command:print *the_a_ref
- // gdbg-check:$1 = TheA
--// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
-+// gdbr-check:$1 = borrowed_c_style_enum::TheA
-
- // gdb-command:print *the_b_ref
- // gdbg-check:$2 = TheB
--// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
-+// gdbr-check:$2 = borrowed_c_style_enum::TheB
-
- // gdb-command:print *the_c_ref
- // gdbg-check:$3 = TheC
--// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
-+// gdbr-check:$3 = borrowed_c_style_enum::TheC
-
-
- // === LLDB TESTS ==================================================================================
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs 2019-02-04 12:49:34.051483727 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs 2019-02-04 13:02:00.981997525 -0800
-@@ -19,31 +19,31 @@
-
- // gdb-command:print tuple_interior_padding
- // gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
--// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
-+// gdbr-check:$1 = (0, c_style_enum_in_composite::OneHundred)
-
- // gdb-command:print tuple_padding_at_end
- // gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
--// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
-+// gdbr-check:$2 = ((1, c_style_enum_in_composite::OneThousand), 2)
-
- // gdb-command:print tuple_different_enums
- // gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
--// gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)
-+// gdbr-check:$3 = (c_style_enum_in_composite::OneThousand, c_style_enum_in_composite::MountainView, c_style_enum_in_composite::OneMillion, c_style_enum_in_composite::Vienna)
-
- // gdb-command:print padded_struct
- // gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
--// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}
-+// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::OneMillion, c: 4, d: c_style_enum_in_composite::Toronto, e: 5}
-
- // gdb-command:print packed_struct
- // gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
--// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}
-+// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::OneHundred, c: 7, d: c_style_enum_in_composite::Vienna, e: 8}
-
- // gdb-command:print non_padded_struct
- // gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
--// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}
-+// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::OneMillion, b: c_style_enum_in_composite::MountainView, c: c_style_enum_in_composite::OneThousand, d: c_style_enum_in_composite::Toronto}
-
- // gdb-command:print struct_with_drop
- // gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
--// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)
-+// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::OneHundred, b: c_style_enum_in_composite::Vienna}, 9)
-
- // === LLDB TESTS ==================================================================================
-
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs 2019-02-04 12:49:34.043483393 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs 2019-02-04 13:02:17.954691634 -0800
-@@ -27,15 +27,15 @@
-
- // gdb-command: print c_style_enum1
- // gdbg-check:$3 = CStyleEnumVar1
--// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar1
-+// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar1
-
- // gdb-command: print c_style_enum2
- // gdbg-check:$4 = CStyleEnumVar2
--// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar2
-+// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar2
-
- // gdb-command: print c_style_enum3
- // gdbg-check:$5 = CStyleEnumVar3
--// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar3
-+// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar3
-
- #![allow(dead_code, unused_variables)]
diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch
deleted file mode 100644
index 40220e8e77..0000000000
--- a/gnu/packages/patches/rust-1.45-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416
-diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
-index e64aafa599f..12575ac4358 100644
---- a/src/librustc_codegen_ssa/back/linker.rs
-+++ b/src/librustc_codegen_ssa/back/linker.rs
-@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
- pub fn disable_localization(linker: &mut Command) {
- // No harm in setting both env vars simultaneously.
- // Unix-style linkers.
-- linker.env("LC_ALL", "C");
-+ linker.env("LC_ALL", "en_US.UTF-8");
- // MSVC's `link.exe`.
- linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-1.48-linker-locale.patch b/gnu/packages/patches/rust-1.48-linker-locale.patch
deleted file mode 100644
index d06dcbe682..0000000000
--- a/gnu/packages/patches/rust-1.48-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://github.com/rust-lang/rust/pull/74416
-diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
-index 3df956c465e..f45fee45be4 100644
---- a/compiler/rustc_codegen_ssa/src/back/linker.rs
-+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
-@@ -28,7 +28,7 @@
- pub fn disable_localization(linker: &mut Command) {
- // No harm in setting both env vars simultaneously.
- // Unix-style linkers.
-- linker.env("LC_ALL", "C");
-+ linker.env("LC_ALL", "en_US.UTF-8");
- // MSVC's `link.exe`.
- linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
deleted file mode 100644
index e8484903e5..0000000000
--- a/gnu/packages/patches/rust-bootstrap-stage0-test.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Bootstrap tests failed with local stage0 cargo and rustc
-Backported changes from https://github.com/rust-lang/rust/pull/51977
-
-From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001
-From: Nikolai Merinov <nikolai.merinov@member.fsf.org>
-Date: Mon, 2 Jul 2018 01:45:35 +0500
-Subject: [PATCH] bootstrap: tests should use rustc from config.toml
-
-Tests should always use "rustc" and "cargo" from config.toml instead
-of assuming that stage0 binaries was downloaded to build directory.
----
- src/bootstrap/bootstrap.py | 2 ++
- src/bootstrap/config.rs | 6 ++----
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
-index 487440becf..1701f7b83a 100644
---- a/src/bootstrap/bootstrap.py
-+++ b/src/bootstrap/bootstrap.py
-@@ -788,6 +788,8 @@ def bootstrap(help_triggered):
- env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
- env["BOOTSTRAP_PYTHON"] = sys.executable
- env["BUILD_DIR"] = build.build_dir
-+ env["CARGO"] = build.cargo()
-+ env["RUSTC"] = build.rustc()
- run(args, env=env, verbose=build.verbose)
-
-
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 6dd6291be2..d1a0deb583 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -23,7 +23,6 @@ use std::cmp;
-
- use num_cpus;
- use toml;
--use util::exe;
- use cache::{INTERNER, Interned};
- use flags::Flags;
- pub use flags::Subcommand;
-@@ -362,9 +361,8 @@ impl Config {
- config.src = Config::path_from_python("SRC");
- config.out = Config::path_from_python("BUILD_DIR");
-
-- let stage0_root = config.out.join(&config.build).join("stage0/bin");
-- config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
-- config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
-+ config.initial_rustc = Config::path_from_python("RUSTC");
-+ config.initial_cargo = Config::path_from_python("CARGO");
-
- config
- }
---
-2.17.1
-
diff --git a/gnu/packages/patches/tcl-fix-cross-compilation.patch b/gnu/packages/patches/tcl-fix-cross-compilation.patch
deleted file mode 100644
index 00c36b8f27..0000000000
--- a/gnu/packages/patches/tcl-fix-cross-compilation.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f7fa48c4c75a1e748dc5071e709c0b62ff739eaa Mon Sep 17 00:00:00 2001
-From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
-Date: Mon, 9 Dec 2019 10:02:20 +0000
-Subject: [PATCH] Fix [abd4abedd2]: Failed to build tk 8.6.10 with cross
- compile
-
-Patch taken from upstream to fix cross-compilation. To be removed on next Tcl release.
-
----
- compat/strtol.c | 2 +-
- compat/strtoul.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/compat/strtol.c b/compat/strtol.c
-index b7f69196ce2..811006a64c3 100644
---- a/compat/strtol.c
-+++ b/compat/strtol.c
-@@ -53,7 +53,7 @@ strtol(
- */
-
- p = string;
-- while (TclIsSpaceProc(*p)) {
-+ while (isspace(UCHAR(*p))) {
- p += 1;
- }
-
-diff --git a/compat/strtoul.c b/compat/strtoul.c
-index e37eb05f823..15587f1da1a 100644
---- a/compat/strtoul.c
-+++ b/compat/strtoul.c
-@@ -74,7 +74,7 @@ strtoul(
- */
-
- p = string;
-- while (TclIsSpaceProc(*p)) {
-+ while (isspace(UCHAR(*p))) {
- p += 1;
- }
- if (*p == '-') {
diff --git a/gnu/packages/patches/tcsh-fix-autotest.patch b/gnu/packages/patches/tcsh-fix-autotest.patch
index 200867cb9b..9f5790641b 100644
--- a/gnu/packages/patches/tcsh-fix-autotest.patch
+++ b/gnu/packages/patches/tcsh-fix-autotest.patch
@@ -63,17 +63,6 @@
AT_DATA([comment2.csh],
[[echo testing...@%:@\
---- tests/subst.at
-+++ tests/subst.at
-@@ -54,7 +54,7 @@ AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
- , [1
- ])
-
--AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)/foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
-+AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)//foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
- | wc -l | tr -d ' \t'], , [1
- ])
-
--- tests/variables.at
+++ tests/variables.at
@@ -666,7 +666,8 @@ set listflags=(-xA $cwd/args.sh)
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.83.patch b/gnu/packages/patches/texlive-bin-poppler-0.83.patch
deleted file mode 100644
index 5e57e3efac..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.83.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Fix build with Poppler 0.83 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.83.patch?h=packages/texlive-bin
-
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-@@ -723,7 +723,7 @@
- #endif
- // initialize
- if (!isInit) {
-- globalParams = new GlobalParams();
-+ globalParams.reset(new GlobalParams());
- globalParams->setErrQuiet(false);
- isInit = true;
- }
-@@ -1108,6 +1108,5 @@
- delete_document(p);
- }
- // see above for globalParams
-- delete globalParams;
- }
- }
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-@@ -79,7 +79,7 @@
- exit(1);
- }
- fileName = new GString(argv[1]);
-- globalParams = new GlobalParams();
-+ globalParams.reset(new GlobalParams());
- doc = new PDFDoc(fileName);
- if (!doc->isOk()) {
- fprintf(stderr, "Invalid PDF file\n");
-@@ -100,7 +100,7 @@
- if (objnum == 0) {
- srcStream = catalogDict.dictLookup("SourceObject");
- static char const_SourceFile[] = "SourceFile";
-- if (!srcStream.isStream(const_SourceFile)) {
-+ if (!srcStream.isDict(const_SourceFile)) {
- fprintf(stderr, "No SourceObject found\n");
- exit(1);
- }
-@@ -202,5 +202,4 @@
- fprintf(stderr, "Cross-reference table extracted to %s\n", outname);
- fclose(outfile);
- delete doc;
-- delete globalParams;
- }
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.86.patch b/gnu/packages/patches/texlive-bin-poppler-0.86.patch
deleted file mode 100644
index b1adca657b..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.86.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fix build with Poppler 0.86 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.86.patch?h=packages/texlive-bin
-
---- a/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc 2020-03-03 21:11:35.102711802 +0000
-+++ b/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc 2020-03-03 21:13:13.057420111 +0000
-@@ -757,7 +757,7 @@
- if (page_name) {
- // get page by name
- GString name(page_name);
-- LinkDest *link = pdf_doc->doc->findDest(&name);
-+ LinkDest *link = pdf_doc->doc->findDest(&name).get();
- if (link == 0 || !link->isOk())
- pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
- Ref ref = link->getPageRef();
diff --git a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch b/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
deleted file mode 100644
index 48b5eb18eb..0000000000
--- a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Description: fix race condition allowing attackers to access destination file
- This commit addresses https://github.com/facebook/zstd/issues/2491.
- .
- Note that a downside of this solution is that it is global: `umask()` affects
- all file creation calls in the process. I believe this is safe since
- `fileio.c` functions should only ever be used in the zstd binary, and these
- are (almost) the only files ever created by zstd, and AIUI they're only
- created in a single thread. So we can get away with messing with global state.
- .
- Note that this doesn't change the permissions of files created by `dibio.c`.
- I'm not sure what those should be...
-Author: W. Felix Handte <w@felixhandte.com>
-Origin: upstream
-Bug: https://github.com/facebook/zstd/issues/2491
-Bug-Debian: https://github.com/facebook/zstd/issues/2491
-Applied-Upstream: commit:a774c5797399040af62db21d8a9b9769e005430e
-Reviewed-by: Étienne Mollier <etienne.mollier@mailoo.org>
-Last-Update: 2021-03-03
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/programs/fileio.c
-+++ b/programs/fileio.c
-@@ -606,11 +606,11 @@ FIO_openDstFile(FIO_prefs_t* const prefs
- FIO_remove(dstFileName);
- } }
-
-- { FILE* const f = fopen( dstFileName, "wb" );
-+ { const int old_umask = UTIL_umask(0177); /* u-x,go-rwx */
-+ FILE* const f = fopen( dstFileName, "wb" );
-+ UTIL_umask(old_umask);
- if (f == NULL) {
- DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
-- } else if(srcFileName != NULL && strcmp (srcFileName, stdinmark)) {
-- chmod(dstFileName, 00600);
- }
- return f;
- }
---- a/programs/util.c
-+++ b/programs/util.c
-@@ -54,6 +54,15 @@ int UTIL_getFileStat(const char* infilen
- return 1;
- }
-
-+int UTIL_umask(int mode) {
-+#if PLATFORM_POSIX_VERSION > 0
-+ return umask(mode);
-+#else
-+ /* do nothing, fake return value */
-+ return mode;
-+#endif
-+}
-+
- int UTIL_setFileStat(const char *filename, stat_t *statbuf)
- {
- int res = 0;
---- a/programs/util.h
-+++ b/programs/util.h
-@@ -136,6 +136,10 @@ int UTIL_isSameFile(const char* file1, c
- int UTIL_compareStr(const void *p1, const void *p2);
- int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
- const char* UTIL_getFileExtension(const char* infilename);
-+/**
-+ * Wraps umask(). Does nothing when the platform doesn't have that concept.
-+ */
-+int UTIL_umask(int mode);
-
- #ifndef _MSC_VER
- U32 UTIL_isFIFO(const char* infilename);
diff --git a/gnu/packages/patches/zziplib-CVE-2018-16548.patch b/gnu/packages/patches/zziplib-CVE-2018-16548.patch
deleted file mode 100644
index a17c6a9768..0000000000
--- a/gnu/packages/patches/zziplib-CVE-2018-16548.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-The following 3 patches applied to 0.13.69 in this order, combined:
-https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch
-https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch
-https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch
-
-diff --git a/test/test.zip b/test/test.zip
-index 2c992ea..952d475 100644
-Binary files a/test/test.zip and b/test/test.zip differ
-diff --git a/zzip/zip.c b/zzip/zip.c
-index 14e2e06..f97a40a 100644
---- a/zzip/zip.c
-+++ b/zzip/zip.c
-@@ -472,9 +472,15 @@ __zzip_parse_root_directory(int fd,
- } else
- {
- if (io->fd.seeks(fd, zz_rootseek + zz_offset, SEEK_SET) < 0)
-+ {
-+ free(hdr0);
- return ZZIP_DIR_SEEK;
-+ }
- if (io->fd.read(fd, &dirent, sizeof(dirent)) < __sizeof(dirent))
-+ {
-+ free(hdr0);
- return ZZIP_DIR_READ;
-+ }
- d = &dirent;
- }
-
-@@ -574,11 +580,18 @@ __zzip_parse_root_directory(int fd,
-
- if (hdr_return)
- *hdr_return = hdr0;
-+ else
-+ {
-+ /* If it is not assigned to *hdr_return, it will never be free()'d */
-+ free(hdr0);
-+ }
- } /* else zero (sane) entries */
-+ else
-+ free(hdr0);
- # ifndef ZZIP_ALLOW_MODULO_ENTRIES
-- return (entries != zz_entries ? ZZIP_CORRUPTED : 0);
-+ return (entries != zz_entries) ? ZZIP_CORRUPTED : 0;
- # else
-- return ((entries & (unsigned)0xFFFF) != zz_entries ? ZZIP_CORRUPTED : 0);
-+ return ((entries & (unsigned)0xFFFF) != zz_entries) ? ZZIP_CORRUPTED : 0;
- # endif
- }
-