diff options
Diffstat (limited to 'gnu/packages/patches')
56 files changed, 900 insertions, 3576 deletions
diff --git a/gnu/packages/patches/autotrace-glib-compat.patch b/gnu/packages/patches/autotrace-glib-compat.patch deleted file mode 100644 index e63dcedf83..0000000000 --- a/gnu/packages/patches/autotrace-glib-compat.patch +++ /dev/null @@ -1,50 +0,0 @@ -Fix build with GLib 2.68 and later. - -Taken from upstream pull request: -https://github.com/autotrace/autotrace/pull/41 - -diff --git a/src/autotrace.h b/src/autotrace.h ---- a/src/autotrace.h -+++ b/src/autotrace.h -@@ -23,6 +23,9 @@ - - #include <stdio.h> - -+#include "types.h" -+#include "color.h" -+ - #ifdef __cplusplus - extern "C" { - #endif /* __cplusplus */ -@@ -35,9 +38,6 @@ extern "C" { - * Typedefs - * ===================================================================== */ - --#include "types.h" --#include "color.h" -- - /* Third degree is the highest we deal with. */ - enum _at_polynomial_degree { - AT_LINEARTYPE = 1, -diff --git a/src/color.h b/src/color.h ---- a/src/color.h -+++ b/src/color.h -@@ -24,6 +24,10 @@ - #include <glib.h> - #include <glib-object.h> - -+#ifdef __cplusplus -+extern "C" { -+#endif /* __cplusplus */ -+ - typedef struct _at_color at_color; - struct _at_color { - guint8 r; -@@ -43,4 +47,7 @@ void at_color_free(at_color * color); - GType at_color_get_type(void); - #define AT_TYPE_COLOR (at_color_get_type ()) - -+#ifdef __cplusplus -+} -+#endif /* __cplusplus */ - #endif /* not AT_COLOR_H */ diff --git a/gnu/packages/patches/bash-completion-directories.patch b/gnu/packages/patches/bash-completion-directories.patch index 021e34653b..a9b88203bd 100644 --- a/gnu/packages/patches/bash-completion-directories.patch +++ b/gnu/packages/patches/bash-completion-directories.patch @@ -4,24 +4,28 @@ up by the dynamic completion loader from there---whether they are part of bash-completion or installed by another package. On Guix systems, we want not only to search within bash-completion's own -directory, but also in the user's profile and in the system profile. +directory, but also in the user's profile and guix home profile, as well +as in the system profile. This is what this patch does. --- a/bash_completion +++ b/bash_completion -@@ -2016,7 +2016,13 @@ complete -F _minimal '' +@@ -2173,7 +2173,15 @@ complete -F _minimal '' __load_completion() { -- local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions ) +- local -a dirs=(${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions) + local -a dirs=( + ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions -+ "$HOME/.guix-profile/share/bash-completion/completions/$base" -+ "$HOME/.guix-profile/etc/bash_completion.d/$base" -+ "/run/current-system/profile/share/bash-completion/completions/$base" -+ "/run/current-system/profile/etc/bash_completion.d/$base" ) ++ "$HOME/.guix-profile/share/bash-completion/completions" ++ "$HOME/.guix-profile/etc/bash_completion.d" ++ "$HOME/.guix-home/profile/share/bash-completion/completions" ++ "$HOME/.guix-home/profile/etc/bash_completion.d" ++ "/run/current-system/profile/share/bash-completion/completions" ++ "/run/current-system/profile/etc/bash_completion.d" ) + - local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile + local ifs=$IFS IFS=: dir cmd="${1##*/}" compfile + [[ -n $cmd ]] || return 1 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do dirs+=( $dir/bash-completion/completions ) diff --git a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch deleted file mode 100644 index 1fd3d3d9b7..0000000000 --- a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <[email protected]> -Date: Mon, 26 Jul 2021 05:59:55 -0700 -Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd - -Close the file descriptor if there is no archive plugin file descriptor -to avoid running out of file descriptors on thin archives with many -archive members. - -bfd/ - - PR ld/28138 - * plugin.c (bfd_plugin_close_file_descriptor): Close the file - descriptor there is no archive plugin file descriptor. - -ld/ - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for - native build. - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. - * testsuite/ld-plugin/pr28138.c: New file. - * testsuite/ld-plugin/pr28138-1.c: Likewise. - * testsuite/ld-plugin/pr28138-2.c: Likewise. - * testsuite/ld-plugin/pr28138-3.c: Likewise. - * testsuite/ld-plugin/pr28138-4.c: Likewise. - * testsuite/ld-plugin/pr28138-5.c: Likewise. - * testsuite/ld-plugin/pr28138-6.c: Likewise. - * testsuite/ld-plugin/pr28138-7.c: Likewise. - -(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) -(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) ---- - bfd/plugin.c | 8 +++++++ - ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++ - ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++ - 10 files changed, 104 insertions(+) - create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c - create mode 100644 ld/testsuite/ld-plugin/pr28138.c - -diff --git a/bfd/plugin.c b/bfd/plugin.c -index 6cfa2b66470..3bab8febe88 100644 ---- a/bfd/plugin.c -+++ b/bfd/plugin.c -@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd) - && !bfd_is_thin_archive (abfd->my_archive)) - abfd = abfd->my_archive; - -+ /* Close the file descriptor if there is no archive plugin file -+ descriptor. */ -+ if (abfd->archive_plugin_fd == -1) -+ { -+ close (fd); -+ return; -+ } -+ - abfd->archive_plugin_fd_open_count--; - /* Dup the archive plugin file descriptor for later use, which - will be closed by _bfd_archive_close_and_cleanup. */ -diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp -index def69e43ab3..999d911ce6a 100644 ---- a/ld/testsuite/ld-plugin/lto.exp -+++ b/ld/testsuite/ld-plugin/lto.exp -@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } { - } - } - -+run_cc_link_tests [list \ -+ [list \ -+ "Build pr28138.a" \ -+ "-T" "" \ -+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ -+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ -+ ] \ -+ [list \ -+ "Build pr28138.o" \ -+ "" "" \ -+ {pr28138.c} {} \ -+ ] \ -+] -+ -+set exec_output [run_host_cmd "sh" \ -+ "-c \"ulimit -n 20; \ -+ $CC -Btmpdir/ld -o tmpdir/pr28138 \ -+ tmpdir/pr28138.o tmpdir/pr28138.a\""] -+set exec_output [prune_warnings $exec_output] -+if [string match "" $exec_output] then { -+ if { [isnative] } { -+ set exec_output [run_host_cmd "tmpdir/pr28138" ""] -+ if [string match "PASS" $exec_output] then { -+ pass "PR ld/28138" -+ } else { -+ fail "PR ld/28138" -+ } -+ } else { -+ pass "PR ld/28138" -+ } -+} else { -+ fail "PR ld/28138" -+} -+ - set testname "Build liblto-11.a" - remote_file host delete "tmpdir/liblto-11.a" - set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] -diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c -new file mode 100644 -index 00000000000..51d119e1642 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-1.c -@@ -0,0 +1,6 @@ -+extern int a0(void); -+int -+a1(void) -+{ -+ return 1 + a0(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c -new file mode 100644 -index 00000000000..1120cd797e9 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-2.c -@@ -0,0 +1,6 @@ -+extern int a1(void); -+int -+a2(void) -+{ -+ return 1 + a1(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c -new file mode 100644 -index 00000000000..ec464947ee6 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-3.c -@@ -0,0 +1,6 @@ -+extern int a2(void); -+int -+a3(void) -+{ -+ return 1 + a2(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c -new file mode 100644 -index 00000000000..475701b2c5c ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-4.c -@@ -0,0 +1,6 @@ -+extern int a3(void); -+int -+a4(void) -+{ -+ return 1 + a3(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c -new file mode 100644 -index 00000000000..e24f86c363e ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-5.c -@@ -0,0 +1,6 @@ -+extern int a4(void); -+int -+a5(void) -+{ -+ return 1 + a4(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c -new file mode 100644 -index 00000000000..b5b938bdb21 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-6.c -@@ -0,0 +1,6 @@ -+extern int a5(void); -+int -+a6(void) -+{ -+ return 1 + a5(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c -new file mode 100644 -index 00000000000..4ef75bf0f0c ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-7.c -@@ -0,0 +1,6 @@ -+extern int a6(void); -+int -+a7(void) -+{ -+ return 1 + a6(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c -new file mode 100644 -index 00000000000..68252c9f382 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138.c -@@ -0,0 +1,20 @@ -+#include <stdio.h> -+ -+extern int a7(void); -+ -+int -+a0(void) -+{ -+ return 0; -+} -+ -+int -+main() -+{ -+ if (a7() == 7) -+ { -+ printf ("PASS\n"); -+ return 0; -+ } -+ return 1; -+} --- -2.27.0 diff --git a/gnu/packages/patches/binutils-CVE-2021-45078.patch b/gnu/packages/patches/binutils-CVE-2021-45078.patch deleted file mode 100644 index fca692bdb5..0000000000 --- a/gnu/packages/patches/binutils-CVE-2021-45078.patch +++ /dev/null @@ -1,257 +0,0 @@ -Fix CVE-2021-45078 (incomplete fix for CVE-2018-12699): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45078 -https://sourceware.org/bugzilla/show_bug.cgi?id=28694 - -Patch copied from upstream source repository: - -https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=161e87d12167b1e36193385485c1f6ce92f74f02 - -From 161e87d12167b1e36193385485c1f6ce92f74f02 Mon Sep 17 00:00:00 2001 -From: Alan Modra <[email protected]> -Date: Wed, 15 Dec 2021 11:48:42 +1030 -Subject: [PATCH] PR28694, Out-of-bounds write in stab_xcoff_builtin_type - - PR 28694 - * stabs.c (stab_xcoff_builtin_type): Make typenum unsigned. - Negate typenum earlier, simplifying bounds checking. Correct - off-by-one indexing. Adjust switch cases. ---- - binutils/stabs.c | 87 ++++++++++++++++++++++++------------------------ - 1 file changed, 43 insertions(+), 44 deletions(-) - -diff --git a/binutils/stabs.c b/binutils/stabs.c -index 274bfb0e7fa..83ee3ea5fa4 100644 ---- a/binutils/stabs.c -+++ b/binutils/stabs.c -@@ -202,7 +202,7 @@ static debug_type stab_find_type (void *, struct stab_handle *, const int *); - static bool stab_record_type - (void *, struct stab_handle *, const int *, debug_type); - static debug_type stab_xcoff_builtin_type -- (void *, struct stab_handle *, int); -+ (void *, struct stab_handle *, unsigned int); - static debug_type stab_find_tagged_type - (void *, struct stab_handle *, const char *, int, enum debug_type_kind); - static debug_type *stab_demangle_argtypes -@@ -3496,166 +3496,167 @@ stab_record_type (void *dhandle ATTRIBUTE_UNUSED, struct stab_handle *info, - - static debug_type - stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info, -- int typenum) -+ unsigned int typenum) - { - debug_type rettype; - const char *name; - -- if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT) -+ typenum = -typenum - 1; -+ if (typenum >= XCOFF_TYPE_COUNT) - { -- fprintf (stderr, _("Unrecognized XCOFF type %d\n"), typenum); -+ fprintf (stderr, _("Unrecognized XCOFF type %d\n"), -typenum - 1); - return DEBUG_TYPE_NULL; - } -- if (info->xcoff_types[-typenum] != NULL) -- return info->xcoff_types[-typenum]; -+ if (info->xcoff_types[typenum] != NULL) -+ return info->xcoff_types[typenum]; - -- switch (-typenum) -+ switch (typenum) - { -- case 1: -+ case 0: - /* The size of this and all the other types are fixed, defined - by the debugging format. */ - name = "int"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 2: -+ case 1: - name = "char"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 3: -+ case 2: - name = "short"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 4: -+ case 3: - name = "long"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 5: -+ case 4: - name = "unsigned char"; - rettype = debug_make_int_type (dhandle, 1, true); - break; -- case 6: -+ case 5: - name = "signed char"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 7: -+ case 6: - name = "unsigned short"; - rettype = debug_make_int_type (dhandle, 2, true); - break; -- case 8: -+ case 7: - name = "unsigned int"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 9: -+ case 8: - name = "unsigned"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 10: -+ case 9: - name = "unsigned long"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 11: -+ case 10: - name = "void"; - rettype = debug_make_void_type (dhandle); - break; -- case 12: -+ case 11: - /* IEEE single precision (32 bit). */ - name = "float"; - rettype = debug_make_float_type (dhandle, 4); - break; -- case 13: -+ case 12: - /* IEEE double precision (64 bit). */ - name = "double"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 14: -+ case 13: - /* This is an IEEE double on the RS/6000, and different machines - with different sizes for "long double" should use different - negative type numbers. See stabs.texinfo. */ - name = "long double"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 15: -+ case 14: - name = "integer"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 16: -+ case 15: - name = "boolean"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 17: -+ case 16: - name = "short real"; - rettype = debug_make_float_type (dhandle, 4); - break; -- case 18: -+ case 17: - name = "real"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 19: -+ case 18: - /* FIXME */ - name = "stringptr"; - rettype = NULL; - break; -- case 20: -+ case 19: - /* FIXME */ - name = "character"; - rettype = debug_make_int_type (dhandle, 1, true); - break; -- case 21: -+ case 20: - name = "logical*1"; - rettype = debug_make_bool_type (dhandle, 1); - break; -- case 22: -+ case 21: - name = "logical*2"; - rettype = debug_make_bool_type (dhandle, 2); - break; -- case 23: -+ case 22: - name = "logical*4"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 24: -+ case 23: - name = "logical"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 25: -+ case 24: - /* Complex type consisting of two IEEE single precision values. */ - name = "complex"; - rettype = debug_make_complex_type (dhandle, 8); - break; -- case 26: -+ case 25: - /* Complex type consisting of two IEEE double precision values. */ - name = "double complex"; - rettype = debug_make_complex_type (dhandle, 16); - break; -- case 27: -+ case 26: - name = "integer*1"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 28: -+ case 27: - name = "integer*2"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 29: -+ case 28: - name = "integer*4"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 30: -+ case 29: - /* FIXME */ - name = "wchar"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 31: -+ case 30: - name = "long long"; - rettype = debug_make_int_type (dhandle, 8, false); - break; -- case 32: -+ case 31: - name = "unsigned long long"; - rettype = debug_make_int_type (dhandle, 8, true); - break; -- case 33: -+ case 32: - name = "logical*8"; - rettype = debug_make_bool_type (dhandle, 8); - break; -- case 34: -+ case 33: - name = "integer*8"; - rettype = debug_make_int_type (dhandle, 8, false); - break; -@@ -3664,9 +3665,7 @@ stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info, - } - - rettype = debug_name_type (dhandle, name, rettype); -- -- info->xcoff_types[-typenum] = rettype; -- -+ info->xcoff_types[typenum] = rettype; - return rettype; - } - --- -2.27.0 - diff --git a/gnu/packages/patches/cmake-curl-certificates.patch b/gnu/packages/patches/cmake-curl-certificates.patch deleted file mode 100644 index 7fe2615271..0000000000 --- a/gnu/packages/patches/cmake-curl-certificates.patch +++ /dev/null @@ -1,40 +0,0 @@ -By default commands such as "ctest" would not look for certificates -at all: <https://issues.guix.gnu.org/issue/37371>. - -This changes CMake such that commands honor SSL_CERT_FILE and SSL_CERT_DIR -as well as /etc/ssl/certs. - ---- cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:27:36.926907260 +0200 -+++ cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:52:35.475903919 +0200 -@@ -2,11 +2,8 @@ - file Copyright.txt or https://cmake.org/licensing for details. */ - #include "cmCurl.h" - --#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \ -- !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) - # define CMAKE_FIND_CAFILE - # include "cmSystemTools.h" --#endif - #include "cmStringAlgorithms.h" - - // curl versions before 7.21.5 did not provide this error code -@@ -30,6 +27,19 @@ - ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); - } -+ -+ /* Honor the usual environment variables. */ -+ else if (cmSystemTools::GetEnv("SSL_CERT_FILE", e)) { -+ ::CURLcode res = -+ ::curl_easy_setopt(curl, CURLOPT_CAINFO, e.c_str()); -+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); -+ } -+ else if (cmSystemTools::GetEnv("SSL_CERT_DIR", e)) { -+ ::CURLcode res = -+ ::curl_easy_setopt(curl, CURLOPT_CAPATH, e.c_str()); -+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); -+ } -+ - #ifdef CMAKE_FIND_CAFILE - # define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" - else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) { diff --git a/gnu/packages/patches/coreutils-ls.patch b/gnu/packages/patches/coreutils-ls.patch deleted file mode 100644 index 59cbbf00b5..0000000000 --- a/gnu/packages/patches/coreutils-ls.patch +++ /dev/null @@ -1,117 +0,0 @@ -Patch taken from upstream to fix cross-compilation for aarch64. This can be -removed on the next coreutils release. - -From 10fcb97bd728f09d4a027eddf8ad2900f0819b0a Mon Sep 17 00:00:00 2001 -From: Paul Eggert <[email protected]> -Date: Thu, 5 Mar 2020 17:25:29 -0800 -Subject: [PATCH] ls: restore 8.31 behavior on removed directories - -* NEWS: Mention this. -* src/ls.c: Do not include <sys/sycall.h> -(print_dir): Don't worry about whether the directory is removed. -* tests/ls/removed-directory.sh: Adjust to match new (i.e., old) -behavior. ---- - NEWS | 6 ++++++ - src/ls.c | 22 ---------------------- - tests/ls/removed-directory.sh | 10 ++-------- - 3 files changed, 8 insertions(+), 30 deletions(-) - -diff --git a/NEWS b/NEWS -index fdc8bf5db..653e7178b 100644 ---- a/NEWS -+++ b/NEWS -@@ -2,6 +2,12 @@ GNU coreutils NEWS -*- outline -*- - - * Noteworthy changes in release ?.? (????-??-??) [?] - -+** Changes in behavior -+ -+ On GNU/Linux systems, ls no longer issues an error message on -+ directory merely because it was removed. This reverts a change -+ that was made in release 8.32. -+ - - * Noteworthy changes in release 8.32 (2020-03-05) [stable] - -diff --git a/src/ls.c b/src/ls.c -index 24b983287..4acf5f44d 100644 ---- a/src/ls.c -+++ b/src/ls.c -@@ -49,10 +49,6 @@ - # include <sys/ptem.h> - #endif - --#ifdef __linux__ --# include <sys/syscall.h> --#endif -- - #include <stdio.h> - #include <assert.h> - #include <setjmp.h> -@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) - struct dirent *next; - uintmax_t total_blocks = 0; - static bool first = true; -- bool found_any_entries = false; - - errno = 0; - dirp = opendir (name); -@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) - next = readdir (dirp); - if (next) - { -- found_any_entries = true; - if (! file_ignored (next->d_name)) - { - enum filetype type = unknown; -@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) - if (errno != EOVERFLOW) - break; - } --#ifdef __linux__ -- else if (! found_any_entries) -- { -- /* If readdir finds no directory entries at all, not even "." or -- "..", then double check that the directory exists. */ -- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1 -- && errno != EINVAL) -- { -- /* We exclude EINVAL as that pertains to buffer handling, -- and we've passed NULL as the buffer for simplicity. -- ENOENT is returned if appropriate before buffer handling. */ -- file_failure (command_line_arg, _("reading directory %s"), name); -- } -- break; -- } --#endif - else - break; - -diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh -index e8c835dab..fe8f929a1 100755 ---- a/tests/ls/removed-directory.sh -+++ b/tests/ls/removed-directory.sh -@@ -26,20 +26,14 @@ case $host_triplet in - *) skip_ 'non linux kernel' ;; - esac - --LS_FAILURE=2 -- --cat <<\EOF >exp-err || framework_failure_ --ls: reading directory '.': No such file or directory --EOF -- - cwd=$(pwd) - mkdir d || framework_failure_ - cd d || framework_failure_ - rmdir ../d || framework_failure_ - --returns_ $LS_FAILURE ls >../out 2>../err || fail=1 -+ls >../out 2>../err || fail=1 - cd "$cwd" || framework_failure_ - compare /dev/null out || fail=1 --compare exp-err err || fail=1 -+compare /dev/null err || fail=1 - - Exit $fail diff --git a/gnu/packages/patches/curl-easy-lock.patch b/gnu/packages/patches/curl-easy-lock.patch deleted file mode 100644 index 137106f57c..0000000000 --- a/gnu/packages/patches/curl-easy-lock.patch +++ /dev/null @@ -1,31 +0,0 @@ -This patch is taken from upstream master, and should probably be dropped -with the next release. - -ihttps://github.com/curl/curl/commit/e2e7f54b7bea521fa8373095d0f43261a720cda0.patch - -From e2e7f54b7bea521fa8373095d0f43261a720cda0 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg <[email protected]> -Date: Mon, 27 Jun 2022 08:46:21 +0200 -Subject: [PATCH] easy_lock.h: include sched.h if available to fix build - -Patched-by: Harry Sintonen - -Closes #9054 ---- - lib/easy_lock.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/easy_lock.h b/lib/easy_lock.h -index 819f50ce815b8..1f54289ceb2d3 100644 ---- a/lib/easy_lock.h -+++ b/lib/easy_lock.h -@@ -36,6 +36,9 @@ - - #elif defined (HAVE_ATOMIC) - #include <stdatomic.h> -+#if defined(HAVE_SCHED_YIELD) -+#include <sched.h> -+#endif - - #define curl_simple_lock atomic_bool - #define CURL_SIMPLE_LOCK_INIT false diff --git a/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch b/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch deleted file mode 100644 index acdf682430..0000000000 --- a/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch +++ /dev/null @@ -1,25 +0,0 @@ -From dcc9f51cbd4ed622cfb0f9b1c141eb2ffe3b12f1 Mon Sep 17 00:00:00 2001 -From: Quanah Gibson-Mount <[email protected]> -Date: Tue, 18 Feb 2020 19:05:12 +0000 -Subject: [PATCH] Fix #587 - -Off by one error in common.c, CVE-2019-19906. - -Thanks to Stephan Zeisberg for reporting ---- - lib/common.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/common.c b/lib/common.c -index bc3bf1df..9969d6aa 100644 ---- a/lib/common.c -+++ b/lib/common.c -@@ -190,7 +190,7 @@ int _sasl_add_string(char **out, size_t *alloclen, - - if (add==NULL) add = "(null)"; - -- addlen=strlen(add); /* only compute once */ -+ addlen=strlen(add)+1; /* only compute once */ - if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK) - return SASL_NOMEM; - diff --git a/gnu/packages/patches/freeimage-libtiff-compat.patch b/gnu/packages/patches/freeimage-libtiff-compat.patch new file mode 100644 index 0000000000..00c5bf659a --- /dev/null +++ b/gnu/packages/patches/freeimage-libtiff-compat.patch @@ -0,0 +1,19 @@ +Use the new TIFFFieldSetGetSize API from libtiff 4.4 instead of the +private and removed _TIFFDataSize declared in the unbundling patch. + +Patch taken from Fedora: + + https://src.fedoraproject.org/rpms/freeimage/blob/rawhide/f/freeimage-libtiff44.patch + +diff -rupN --no-dereference freeimage-svn-r1889-FreeImage-trunk/Source/Metadata/XTIFF.cpp freeimage-svn-r1889-FreeImage-trunk-new/Source/Metadata/XTIFF.cpp +--- freeimage-svn-r1889-FreeImage-trunk/Source/Metadata/XTIFF.cpp 2022-06-23 11:56:32.561043826 +0200 ++++ freeimage-svn-r1889-FreeImage-trunk-new/Source/Metadata/XTIFF.cpp 2022-06-23 11:56:32.764043827 +0200 +@@ -747,7 +747,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib:: + continue; + } + // type of storage may differ (e.g. rationnal array vs float array type) +- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { ++ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) { + // skip tag or _TIFFmemcpy will fail + continue; + } diff --git a/gnu/packages/patches/gash-utils-ls-test.patch b/gnu/packages/patches/gash-utils-ls-test.patch deleted file mode 100644 index e1dfb9c23b..0000000000 --- a/gnu/packages/patches/gash-utils-ls-test.patch +++ /dev/null @@ -1,25 +0,0 @@ -'ls.scm' monkey-patches (ice-9 getopt-long) to allow it to recognize '-1' -as a valid option. Unfortunately, monkey patching no longer works with -Guile 3.0 due to inlining, so change the test to make do without '-1'. - -diff --git a/tests/core-utils.org b/tests/core-utils.org -index d35ede8..22718e3 100644 ---- a/tests/core-utils.org -+++ b/tests/core-utils.org -@@ -93,14 +93,11 @@ - * ls - :script: - #+begin_src sh -- ls -1 tests/data/star -+ ls tests/data/star - #+end_src - :stdout: - #+begin_example -- 0 -- 1 -- 2 -- 3 -+ 0 1 2 3 - #+end_example - - * test-file diff --git a/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch new file mode 100644 index 0000000000..aae5fc9f72 --- /dev/null +++ b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch @@ -0,0 +1,33 @@ +Fix a regression in GCC 10/11/12 where some union structures +could get miscompiled when optimizations are enabled: + + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860 + +Taken from upstream: + + https://gcc.gnu.org/g:16afe2e2862f3dd93c711d7f8d436dee23c6c34d + +diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c +index 09d951a261b..420329f63f6 100644 +--- a/gcc/tree-sra.c ++++ b/gcc/tree-sra.c +@@ -1647,7 +1647,18 @@ build_ref_for_offset (location_t loc, tree base, poly_int64 offset, + static tree + build_reconstructed_reference (location_t, tree base, struct access *model) + { +- tree expr = model->expr, prev_expr = NULL; ++ tree expr = model->expr; ++ /* We have to make sure to start just below the outermost union. */ ++ tree start_expr = expr; ++ while (handled_component_p (expr)) ++ { ++ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == UNION_TYPE) ++ start_expr = expr; ++ expr = TREE_OPERAND (expr, 0); ++ } ++ ++ expr = start_expr; ++ tree prev_expr = NULL_TREE; + while (!types_compatible_p (TREE_TYPE (expr), TREE_TYPE (base))) + { + if (!handled_component_p (expr)) diff --git a/gnu/packages/patches/gettext-libunicode-update.patch b/gnu/packages/patches/gettext-libunicode-update.patch new file mode 100644 index 0000000000..2a67f4803a --- /dev/null +++ b/gnu/packages/patches/gettext-libunicode-update.patch @@ -0,0 +1,99 @@ +https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commit;h=56dc658db752c2894861ee574866d507f12a17f8 +Due to the encoding it needs to be retrieved from a git clone. + +commit 56dc658db752c2894861ee574866d507f12a17f8 +Author: Bruno Haible <[email protected]> +Date: Sun Jan 2 15:43:41 2022 +0100 + + Update after gnulib changed. + + * gettext-tools/tests/msgcat-17: Update test for changed libunistring line + breaking behaviour. + * gettext-tools/tests/msgfilter-sr-latin-1: Likewise. + * gettext-tools/tests/msgmerge-11: Likewise. + * gettext-tools/tests/xgettext-python-1: Likewise. + +diff --git a/gettext-tools/tests/msgcat-17 b/gettext-tools/tests/msgcat-17 +index 8fecc4039..c4aa220b9 100755 +--- a/gettext-tools/tests/msgcat-17 ++++ b/gettext-tools/tests/msgcat-17 +@@ -39,9 +39,9 @@ msgstr "" + #, c-format + msgid "write error of a big result on a too small disk% s% s" + msgstr "" +-"Fehler beim Schreiben eines großen Ergebnisses auf eine zu kleine Platte% s" +-"% smit der jederzeitigen Möglichkeit eines Fehlers in jedem Moment und an " +-"jeder Stelle" ++"Fehler beim Schreiben eines großen Ergebnisses auf eine zu kleine " ++"Platte% s% smit der jederzeitigen Möglichkeit eines Fehlers in jedem Moment " ++"und an jeder Stelle" + EOF + + : ${DIFF=diff} +diff --git a/gettext-tools/tests/msgfilter-sr-latin-1 b/gettext-tools/tests/msgfilter-sr-latin-1 +index c1cc97875..29e68c04f 100755 +--- a/gettext-tools/tests/msgfilter-sr-latin-1 ++++ b/gettext-tools/tests/msgfilter-sr-latin-1 +@@ -20,8 +20,8 @@ msgstr "" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=CP1251\n" + "Content-Transfer-Encoding: 8bit\n" +-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && n" +-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" ++"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && " ++"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + + #: ../gettext-tools/lib/closeout.c:64 + msgid "write error" +@@ -332,8 +332,8 @@ msgstr "" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" +-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && n" +-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" ++"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && " ++"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + + #: ../gettext-tools/lib/closeout.c:64 + msgid "write error" +diff --git a/gettext-tools/tests/msgmerge-11 b/gettext-tools/tests/msgmerge-11 +index ed49db95a..888855940 100755 +--- a/gettext-tools/tests/msgmerge-11 ++++ b/gettext-tools/tests/msgmerge-11 +@@ -19,8 +19,8 @@ msgstr "" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=ISO-8859-1\n" + "Content-Transfer-Encoding: 8bit\n" +-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +-"%100==4 ? 2 : 3);\n" ++"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " ++"n%100==4 ? 2 : 3);\n" + + #:foobar.c:29 + #, c-format +@@ -72,8 +72,8 @@ msgstr "" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=ISO-8859-1\n" + "Content-Transfer-Encoding: 8bit\n" +-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +-"%100==4 ? 2 : 3);\n" ++"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " ++"n%100==4 ? 2 : 3);\n" + + #: foobar.c:32 + #, fuzzy, c-format +diff --git a/gettext-tools/tests/xgettext-python-1 b/gettext-tools/tests/xgettext-python-1 +index 4901c71e3..9695abda4 100755 +--- a/gettext-tools/tests/xgettext-python-1 ++++ b/gettext-tools/tests/xgettext-python-1 +@@ -61,8 +61,8 @@ msgstr "" + #. interpret_ansic = false, interpret_unicode = false + msgid "" + "abc\\\n" +-"\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v x\\040x\\x7ey" +-"\\u0142\\U00010123\\N{LATIN SMALL LETTER Z}" ++"\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v " ++"x\\040x\\x7ey\\u0142\\U00010123\\N{LATIN SMALL LETTER Z}" + msgstr "" + + #. interpret_ansic = true, interpret_unicode = true diff --git a/gnu/packages/patches/ghc-testsuite-grep-compat.patch b/gnu/packages/patches/ghc-testsuite-grep-compat.patch new file mode 100644 index 0000000000..a2bd5fcec4 --- /dev/null +++ b/gnu/packages/patches/ghc-testsuite-grep-compat.patch @@ -0,0 +1,39 @@ +Remove stray escapes to avoid warnings from grep 3.8 which breaks +expected test output. + +diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile +--- a/testsuite/tests/hsc2hs/Makefile ++++ b/testsuite/tests/hsc2hs/Makefile +@@ -47,5 +47,5 @@ T12504: + ifeq "$(WINDOWS)" "YES" + grep '{-# LINE 1 \"T12504\\\\path\\\\to\\\\$@\.hsc\" #-}' T12504/path/to/[email protected] + else +- grep '{-# LINE 1 \"T12504/path/to/$@\.hsc\" #-}' T12504/path/to/[email protected] ++ grep '{-# LINE 1 "T12504/path/to/$@\.hsc" #-}' T12504/path/to/[email protected] + endif +diff --git a/testsuite/tests/numeric/should_run/T7014.primops b/testsuite/tests/numeric/should_run/T7014.primops +--- a/testsuite/tests/numeric/should_run/T7014.primops ++++ b/testsuite/tests/numeric/should_run/T7014.primops +@@ -1,8 +1,8 @@ + and# + or# + uncheckedShift.*# +-\+# +-\-# +++# ++-# + \*# + quotInt# + remInt# +diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile +--- a/testsuite/tests/simplCore/should_compile/Makefile ++++ b/testsuite/tests/simplCore/should_compile/Makefile +@@ -226,7 +226,7 @@ str-rules: + # g should have been collapsed into one defininition by CSE. + .PHONY: T13340 + T13340: +- '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#' ++ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '+#' + + + # We expect to see all dictionaries specialized away. diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch index b19f3ab5d9..493693b78d 100644 --- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch +++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch @@ -6,11 +6,11 @@ not write out the "/ID" field (if that's permissible). Upstream does not want to do this. See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff --git a/orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c b/bb/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c -index 0fb067e..b342e2c 100644 ---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c -+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c -@@ -305,6 +305,9 @@ pdf_initialize_ids(gx_device_pdf * pdev) +diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c +index cb268f62e..c5abefde2 100644 +--- a/devices/vector/gdevpdf.c ++++ b/devices/vector/gdevpdf.c +@@ -425,6 +425,9 @@ pdf_initialize_ids(gx_device_pdf * pdev) * date and time, rather than (for example) %%CreationDate from the * PostScript file. We think this is wrong, but we do the same. */ @@ -20,9 +20,11 @@ index 0fb067e..b342e2c 100644 { struct tm tms; time_t t; ---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c -+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c -@@ -692,6 +692,9 @@ +diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c +index ec011d8ba..f083f1e93 100644 +--- a/devices/vector/gdevpdfe.c ++++ b/devices/vector/gdevpdfe.c +@@ -696,6 +696,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) pdf_xml_attribute_name(s, "xmlns:xmp"); pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/"); pdf_xml_tag_end(s); @@ -32,7 +34,7 @@ index 0fb067e..b342e2c 100644 { pdf_xml_tag_open_beg(s, "xmp:ModifyDate"); pdf_xml_tag_end(s); -@@ -700,6 +701,9 @@ +@@ -704,6 +707,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) pdf_xml_tag_close(s, "xmp:ModifyDate"); pdf_xml_newline(s); } diff --git a/gnu/packages/patches/ghostscript-no-header-id.patch b/gnu/packages/patches/ghostscript-no-header-id.patch index 45fc95fd6e..ef518b0fb2 100644 --- a/gnu/packages/patches/ghostscript-no-header-id.patch +++ b/gnu/packages/patches/ghostscript-no-header-id.patch @@ -6,38 +6,39 @@ not write out the "/ID" field (if that's permissible). Upstream does not want to do this. See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c ---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:30:28.960479189 +0200 -+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:34:34.306524488 +0200 -@@ -1810,8 +1810,11 @@ +diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c +index c5abefde2..3859fc088 100644 +--- a/devices/vector/gdevpdf.c ++++ b/devices/vector/gdevpdf.c +@@ -1909,8 +1909,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params * +1 for the linearisation dict and +1 for the primary hint stream. */ linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file); -- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", +- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", - linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0); -+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R", ++ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R", + linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber); + if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */ -+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID); -+ gs_sprintf(LDict, "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0); ++ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID); ++ gs_snprintf(LDict, sizeof(LDict), "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0); gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file); /* Write document catalog (Part 4) */ -@@ -2346,8 +2349,11 @@ +@@ -2445,8 +2448,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params if (code != 0) return_error(gs_error_ioerror); -- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", +- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", - linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref); -+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R", ++ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R", + linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber); + if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */ -+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID); -+ gs_sprintf(LDict, "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref); ++ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID); ++ gs_snprintf(LDict, sizeof(LDict), "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref); gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile); code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET); -@@ -3012,10 +3018,12 @@ +@@ -3139,10 +3145,12 @@ pdf_close(gx_device * dev) stream_puts(s, "trailer\n"); pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n", pdev->next_id, Catalog_id, Info_id); diff --git a/gnu/packages/patches/ghostscript-no-header-uuid.patch b/gnu/packages/patches/ghostscript-no-header-uuid.patch index f4b55764c8..b277a4bc2e 100644 --- a/gnu/packages/patches/ghostscript-no-header-uuid.patch +++ b/gnu/packages/patches/ghostscript-no-header-uuid.patch @@ -8,10 +8,11 @@ field value as "". Upstream does not want to do this. See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c ---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-09 23:30:28.960479189 +0200 -+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-10 01:04:12.252478276 +0200 -@@ -620,7 +620,7 @@ +diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c +index f083f1e93..a19c64ac0 100644 +--- a/devices/vector/gdevpdfe.c ++++ b/devices/vector/gdevpdfe.c +@@ -624,7 +624,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) return code; /* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */ @@ -20,7 +21,7 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip instance_uuid[0] = 0x00; cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time)); -@@ -720,14 +720,17 @@ +@@ -730,14 +730,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) pdf_xml_tag_close(s, "rdf:Description"); pdf_xml_newline(s); diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch index 68c3a94846..647837b983 100644 --- a/gnu/packages/patches/glibc-dl-cache.patch +++ b/gnu/packages/patches/glibc-dl-cache.patch @@ -6,7 +6,7 @@ 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) +@@ -171,6 +171,52 @@ _dl_cache_libcmp (const char *p1, const char *p2) return *p1 - *p2; } @@ -27,7 +27,8 @@ index 93d185e788..e0760a1f40 100644 + const char *origin = _dl_get_origin (); + + /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin". */ -+ if (strncmp (store, origin, strlen (store)) == 0 ++ if (origin != (char *) -1 /* _dl_get_origin reported failure */ ++ && strncmp (store, origin, strlen (store)) == 0 + && origin[sizeof store - 1] == '/') + { + char *store_item_end = strchr (origin + sizeof store, '/'); diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch index e31f99a1ce..b02215550d 100644 --- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch +++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch @@ -67,8 +67,8 @@ index fcd79fd554..1dd02aa449 100644 diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c index 9d8a9ea8ae..3430582c09 100644 ---- a/sysdeps/pthread/timer_create.c -+++ b/sysdeps/pthread/timer_create.c +--- a/rt/timer_create.c ++++ b/rt/timer_create.c @@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) return -1; } diff --git a/gnu/packages/patches/glibc-static-nss.patch b/gnu/packages/patches/glibc-static-nss.patch deleted file mode 100644 index 1a9db616cc..0000000000 --- a/gnu/packages/patches/glibc-static-nss.patch +++ /dev/null @@ -1,1244 +0,0 @@ -This patch reinstates support for static NSS, which glibc 2.33 broke: - - https://sourceware.org/bugzilla/show_bug.cgi?id=27959 - -Patch obtained by running: - - git diff f0c28504a9877be5da3ed1215f2da2d5914bbb0b..f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf - git diff 5e1ce61e3e71fb7ffe53f58fe96e67cb15f94854{^,} - git diff 135425a1dd50cbe2b9db0628d6c2b36c7889f30b{^,} - -It corresponds to these changes: - - f9c8b11ed7 * nss: Access nss_files through direct references - 6212bb67f4 * nss_files: Move into libc - 36861a968a * nss_files: Add generic code for set*ent, end*ent and file open - f0c28504a9 * nss_files: Allocate nscd file registration data on the heap - 5e1ce61e3e * nss: Fix NSS_DECLARE_MODULE_FUNCTIONS handling of _nss_*_endnetgrent - 135425a1dd * nss: Fix build error with --disable-nscd - -... plus a manual fix in 'files-network.c' to address this compilation error: - - nss_files/files-network.c: In function ‘_nss_files_parse_netent’: - nss_files/files-network.c:72:20: error: implicit declaration of function ‘__inet_network’; did you mean ‘inet_network’? [-Werror=implicit-function-declaration] - 72 | result->n_net = __inet_network (addr); - | ^~~~~~~~~~~~~~ - nss_files/files-parse.c:106:3: note: in definition of macro ‘LINE_PARSER’ - 106 | BODY; \ - | ^~~~ - -diff --git a/include/libc-symbols.h b/include/libc-symbols.h -index 127ea656c2..d41ecf4384 100644 ---- a/include/libc-symbols.h -+++ b/include/libc-symbols.h -@@ -798,29 +798,6 @@ for linking") - # define libdl_hidden_data_ver(local, name) - #endif - --#if IS_IN (libnss_files) --# define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) --# define libnss_files_hidden_tls_proto(name, attrs...) \ -- hidden_tls_proto (name, ##attrs) --# define libnss_files_hidden_def(name) hidden_def (name) --# define libnss_files_hidden_weak(name) hidden_weak (name) --# define libnss_files_hidden_ver(local, name) hidden_ver (local, name) --# define libnss_files_hidden_data_def(name) hidden_data_def (name) --# define libnss_files_hidden_tls_def(name) hidden_tls_def (name) --# define libnss_files_hidden_data_weak(name) hidden_data_weak (name) --# define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name) --#else --# define libnss_files_hidden_proto(name, attrs...) --# define libnss_files_hidden_tls_proto(name, attrs...) --# define libnss_files_hidden_def(name) --# define libnss_files_hidden_weak(name) --# define libnss_files_hidden_ver(local, name) --# define libnss_files_hidden_data_def(name) --# define libnss_files_hidden_tls_def(name) --# define libnss_files_hidden_data_weak(name) --# define libnss_files_hidden_data_ver(local, name) --#endif -- - #if IS_IN (libnsl) - # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) - # define libnsl_hidden_tls_proto(name, attrs...) \ -diff --git a/include/netdb.h b/include/netdb.h -index 82e102ff76..4dcdbb8cd4 100644 ---- a/include/netdb.h -+++ b/include/netdb.h -@@ -217,7 +217,7 @@ extern enum nss_status _nss_netgroup_parseline (char **cursor, - struct __netgrent *result, - char *buffer, size_t buflen, - int *errnop); --libnss_files_hidden_proto (_nss_netgroup_parseline) -+libc_hidden_proto (_nss_netgroup_parseline) - - #define DECLARE_NSS_PROTOTYPES(service) \ - extern enum nss_status _nss_ ## service ## _setprotoent (int); \ -diff --git a/include/nss_files.h b/include/nss_files.h -index 6a0dcdb85b..6190cac6be 100644 ---- a/include/nss_files.h -+++ b/include/nss_files.h -@@ -19,7 +19,11 @@ - #ifndef _NSS_FILES_H - #define _NSS_FILES_H - -+#include <nss.h> - #include <stdio.h> -+#if IS_IN (libc) -+#include <libc-lock.h> -+#endif - - /* Open PATH for reading, as a data source for nss_files. */ - FILE *__nss_files_fopen (const char *path); -@@ -47,6 +51,63 @@ int __nss_readline_seek (FILE *fp, off64_t offset) attribute_hidden; - int __nss_parse_line_result (FILE *fp, off64_t offset, int parse_line_result); - libc_hidden_proto (__nss_parse_line_result) - -+/* Per-file data. Used by the *ent functions that need to preserve -+ state across calls. */ -+struct nss_files_per_file_data -+{ -+ FILE *stream; -+#if IS_IN (libc) -+ /* The size of locks changes between libc and nss_files, so this -+ member must be last and is only available in libc. */ -+ __libc_lock_define (, lock); -+#endif -+}; -+ -+/* File index for __nss_files_data_get. */ -+enum nss_files_file -+ { -+ nss_file_aliasent, -+ nss_file_etherent, -+ nss_file_grent, -+ nss_file_hostent, -+ nss_file_netent, -+ nss_file_protoent, -+ nss_file_pwent, -+ nss_file_rpcent, -+ nss_file_servent, -+ nss_file_sgent, -+ nss_file_spent, -+ -+ nss_file_count -+ }; -+ -+/* Obtains a pointer to the per-file data for FILE, which is written -+ to *PDATA, and tries to open the file at PATH for it. On success, -+ returns NSS_STATUS_SUCCESS, and the caller must later call -+ __nss_files_data_put. On failure, NSS_STATUS_TRYAGAIN is returned, -+ and *ERRNOP and *HERRNOP are updated if these pointers are not -+ null. */ -+enum nss_status __nss_files_data_open (struct nss_files_per_file_data **pdata, -+ enum nss_files_file file, -+ const char *path, -+ int *errnop, int *herrnop); -+libc_hidden_proto (__nss_files_data_open) -+ -+/* Unlock the per-file data, previously obtained by -+ __nss_files_data_open. */ -+void __nss_files_data_put (struct nss_files_per_file_data *data); -+libc_hidden_proto (__nss_files_data_put) -+ -+/* Performs the set*ent operation for FILE. PATH is the file to -+ open. */ -+enum nss_status __nss_files_data_setent (enum nss_files_file file, -+ const char *path); -+libc_hidden_proto (__nss_files_data_setent) -+ -+/* Performs the end*ent operation for FILE. */ -+enum nss_status __nss_files_data_endent (enum nss_files_file file); -+libc_hidden_proto (__nss_files_data_endent) -+ - struct parser_data; - - /* Instances of the parse_line function from -@@ -64,16 +125,25 @@ extern nss_files_parse_line _nss_files_parse_servent; - extern nss_files_parse_line _nss_files_parse_sgent; - extern nss_files_parse_line _nss_files_parse_spent; - --libnss_files_hidden_proto (_nss_files_parse_etherent) -+libc_hidden_proto (_nss_files_parse_etherent) - libc_hidden_proto (_nss_files_parse_grent) --libnss_files_hidden_proto (_nss_files_parse_netent) --libnss_files_hidden_proto (_nss_files_parse_protoent) -+libc_hidden_proto (_nss_files_parse_netent) -+libc_hidden_proto (_nss_files_parse_protoent) - libc_hidden_proto (_nss_files_parse_pwent) --libnss_files_hidden_proto (_nss_files_parse_rpcent) --libnss_files_hidden_proto (_nss_files_parse_servent) -+libc_hidden_proto (_nss_files_parse_rpcent) -+libc_hidden_proto (_nss_files_parse_servent) - libc_hidden_proto (_nss_files_parse_sgent) - libc_hidden_proto (_nss_files_parse_spent) - -+NSS_DECLARE_MODULE_FUNCTIONS (files) -+#undef DEFINE_NSS_FUNCTION -+#define DEFINE_NSS_FUNCTION(x) libc_hidden_proto (_nss_files_##x) -+#include <nss/function.def> -+#undef DEFINE_NSS_FUNCTION -+ -+void _nss_files_init (void (*cb) (size_t, struct traced_file *)); -+libc_hidden_proto (_nss_files_init) -+ - /* Generic implementation of fget*ent_r. Reads lines from FP until - EOF or a successful parse into *RESULT using PARSER. Returns 0 on - success, ENOENT on EOF, ERANGE on too-small buffer. */ -diff --git a/nss/Makefile b/nss/Makefile -index 9682a31e20..63a386af18 100644 ---- a/nss/Makefile -+++ b/nss/Makefile -@@ -31,7 +31,8 @@ routines = nsswitch getnssent getnssent_r digits_dots \ - compat-lookup nss_hash nss_files_fopen \ - nss_readline nss_parse_line_result \ - nss_fgetent_r nss_module nss_action \ -- nss_action_parse nss_database -+ nss_action_parse nss_database nss_files_data \ -+ nss_files_functions - - # These are the databases that go through nss dispatch. - # Caution: if you add a database here, you must add its real name -@@ -98,9 +99,11 @@ subdir-dirs = $(services:%=nss_%) - vpath %.c $(subdir-dirs) ../locale/programs ../intl - - --libnss_files-routines := $(addprefix files-, \ -- $(filter-out key, $(databases))) \ -- files-initgroups files-init -+routines += \ -+ $(addprefix files-, $(filter-out key, $(databases))) \ -+ files-init \ -+ files-initgroups \ -+ # routines - - libnss_db-dbs := $(addprefix db-,\ - $(filter-out hosts network key alias,\ -@@ -116,12 +119,9 @@ libnss_compat-routines := $(addprefix compat-,grp pwd spwd initgroups) \ - install-others += $(inst_vardbdir)/Makefile - - # Build static module into libc if requested --libnss_files-inhibit-o = $(filter-out .os,$(object-suffixes)) - libnss_db-inhibit-o = $(filter-out .os,$(object-suffixes)) - libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes)) - ifeq ($(build-static-nss),yes) --routines += $(libnss_files-routines) --static-only-routines += $(libnss_files-routines) - tests-static += tst-nss-static - endif - extra-test-objs += nss_test1.os nss_test2.os -@@ -138,8 +138,6 @@ libnss-libc = $(common-objpfx)linkobj/libc.so - # for new links: - $(services:%=$(objpfx)libnss_%.so): libc-for-link = $(libnss-libc) - --$(objpfx)libnss_db.so: $(objpfx)libnss_files.so -- - $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c - @rm -f [email protected] - (echo '#define EXTERN_PARSER';\ -diff --git a/nss/Versions b/nss/Versions -index fdddea104c..e551524aa9 100644 ---- a/nss/Versions -+++ b/nss/Versions -@@ -19,11 +19,12 @@ libc { - __nss_services_lookup2; __nss_next2; __nss_lookup; - __nss_hash; __nss_database_get; - __nss_files_fopen; __nss_readline; __nss_parse_line_result; -- } --} -+ __nss_files_data_endent; -+ __nss_files_data_open; -+ __nss_files_data_put; -+ __nss_files_data_setent; - --libnss_files { -- GLIBC_PRIVATE { -+ # Routines formerly in libnss_files.so.2. - _nss_files_setaliasent; - _nss_files_endaliasent; - _nss_files_getaliasbyname_r; -@@ -109,6 +110,14 @@ libnss_files { - } - } - -+libnss_files { -+ GLIBC_PRIVATE { -+ # Keep a version node (with a synthesized local: * directive) so that -+ # __bss_* symbols are hidden on targets that need it. -+ __libnss_files_version_placeholder; -+ } -+} -+ - libnss_db { - GLIBC_PRIVATE { - _nss_db_setetherent; -diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c -index b4b989d9bb..c158a891bd 100644 ---- a/nss/nss_files/files-XXX.c -+++ b/nss/nss_files/files-XXX.c -@@ -45,10 +45,12 @@ - # include <netdb.h> - # define H_ERRNO_PROTO , int *herrnop - # define H_ERRNO_ARG , herrnop -+# define H_ERRNO_ARG_OR_NULL herrnop - # define H_ERRNO_SET(val) (*herrnop = (val)) - #else - # define H_ERRNO_PROTO - # define H_ERRNO_ARG -+# define H_ERRNO_ARG_OR_NULL NULL - # define H_ERRNO_SET(val) ((void) 0) - #endif - -@@ -58,15 +60,11 @@ - # define EXTRA_ARGS_VALUE - #endif - --/* Locks the static variables in this file. */ --__libc_lock_define_initialized (static, lock) - - /* Maintenance of the stream open on the database file. For getXXent - operations the stream needs to be held open across calls, the other - getXXbyYY operations all use their own stream. */ - --static FILE *stream; -- - /* Open database file if not already opened. */ - static enum nss_status - internal_setent (FILE **stream) -@@ -91,42 +89,16 @@ internal_setent (FILE **stream) - enum nss_status - CONCAT(_nss_files_set,ENTNAME) (int stayopen) - { -- enum nss_status status; -- -- __libc_lock_lock (lock); -- -- status = internal_setent (&stream); -- -- __libc_lock_unlock (lock); -- -- return status; -+ return __nss_files_data_setent (CONCAT (nss_file_, ENTNAME), DATAFILE); - } -+libc_hidden_def (CONCAT (_nss_files_set,ENTNAME)) - -- --/* Close the database file. */ --static void --internal_endent (FILE **stream) --{ -- if (*stream != NULL) -- { -- fclose (*stream); -- *stream = NULL; -- } --} -- -- --/* Thread-safe, exported version of that. */ - enum nss_status - CONCAT(_nss_files_end,ENTNAME) (void) - { -- __libc_lock_lock (lock); -- -- internal_endent (&stream); -- -- __libc_lock_unlock (lock); -- -- return NSS_STATUS_SUCCESS; -+ return __nss_files_data_endent (CONCAT (nss_file_, ENTNAME)); - } -+libc_hidden_def (CONCAT (_nss_files_end,ENTNAME)) - - - /* Parsing the database file into `struct STRUCTURE' data structures. */ -@@ -194,28 +166,22 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer, - size_t buflen, int *errnop H_ERRNO_PROTO) - { - /* Return next entry in host file. */ -- enum nss_status status = NSS_STATUS_SUCCESS; -- -- __libc_lock_lock (lock); - -- /* Be prepared that the set*ent function was not called before. */ -- if (stream == NULL) -- { -- int save_errno = errno; -- -- status = internal_setent (&stream); -- -- __set_errno (save_errno); -- } -- -- if (status == NSS_STATUS_SUCCESS) -- status = internal_getent (stream, result, buffer, buflen, errnop -- H_ERRNO_ARG EXTRA_ARGS_VALUE); -+ struct nss_files_per_file_data *data; -+ enum nss_status status = __nss_files_data_open (&data, -+ CONCAT (nss_file_, ENTNAME), -+ DATAFILE, -+ errnop, H_ERRNO_ARG_OR_NULL); -+ if (status != NSS_STATUS_SUCCESS) -+ return status; - -- __libc_lock_unlock (lock); -+ status = internal_getent (data->stream, result, buffer, buflen, errnop -+ H_ERRNO_ARG EXTRA_ARGS_VALUE); - -+ __nss_files_data_put (data); - return status; - } -+libc_hidden_def (CONCAT (_nss_files_get,ENTNAME_r)) - - /* Macro for defining lookup functions for this file-based database. - -@@ -248,8 +214,9 @@ _nss_files_get##name##_r (proto, \ - == NSS_STATUS_SUCCESS) \ - { break_if_match } \ - \ -- internal_endent (&stream); \ -+ fclose (stream); \ - } \ - \ - return status; \ --} -+} \ -+libc_hidden_def (_nss_files_get##name##_r) -diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c -index 30971bfe56..8c6e176ff6 100644 ---- a/nss/nss_files/files-alias.c -+++ b/nss/nss_files/files-alias.c -@@ -31,18 +31,11 @@ - #include "nsswitch.h" - #include <nss_files.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- --/* Locks the static variables in this file. */ --__libc_lock_define_initialized (static, lock) - - /* Maintenance of the stream open on the database file. For getXXent - operations the stream needs to be held open across calls, the other - getXXbyYY operations all use their own stream. */ - --static FILE *stream; -- -- - static enum nss_status - internal_setent (FILE **stream) - { -@@ -66,42 +59,16 @@ internal_setent (FILE **stream) - enum nss_status - _nss_files_setaliasent (void) - { -- enum nss_status status; -- -- __libc_lock_lock (lock); -- -- status = internal_setent (&stream); -- -- __libc_lock_unlock (lock); -- -- return status; -+ return __nss_files_data_setent (nss_file_aliasent, "/etc/aliases"); - } -+libc_hidden_def (_nss_files_setaliasent) - -- --/* Close the database file. */ --static void --internal_endent (FILE **stream) --{ -- if (*stream != NULL) -- { -- fclose (*stream); -- *stream = NULL; -- } --} -- -- --/* Thread-safe, exported version of that. */ - enum nss_status - _nss_files_endaliasent (void) - { -- __libc_lock_lock (lock); -- -- internal_endent (&stream); -- -- __libc_lock_unlock (lock); -- -- return NSS_STATUS_SUCCESS; -+ return __nss_files_data_endent (nss_file_aliasent); - } -+libc_hidden_def (_nss_files_endaliasent) - - /* Parsing the database file into `struct aliasent' data structures. */ - static enum nss_status -@@ -131,7 +98,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result, - /* Read the first line. It must contain the alias name and - possibly some alias names. */ - first_unused[room_left - 1] = '\xff'; -- line = fgets_unlocked (first_unused, room_left, stream); -+ line = __fgets_unlocked (first_unused, room_left, stream); - if (line == NULL) - /* Nothing to read. */ - break; -@@ -220,7 +187,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result, - /* If the file does not exist we simply ignore - the statement. */ - if (listfile != NULL -- && (old_line = strdup (line)) != NULL) -+ && (old_line = __strdup (line)) != NULL) - { - while (! feof_unlocked (listfile)) - { -@@ -232,8 +199,8 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result, - } - - first_unused[room_left - 1] = '\xff'; -- line = fgets_unlocked (first_unused, room_left, -- listfile); -+ line = __fgets_unlocked (first_unused, room_left, -+ listfile); - if (line == NULL) - break; - if (first_unused[room_left - 1] != '\xff') -@@ -335,7 +302,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result, - /* The just read character is a white space and so - can be ignored. */ - first_unused[room_left - 1] = '\xff'; -- line = fgets_unlocked (first_unused, room_left, stream); -+ line = __fgets_unlocked (first_unused, room_left, stream); - if (line == NULL) - { - /* Continuation line without any data and -@@ -369,29 +336,25 @@ _nss_files_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen, - int *errnop) - { - /* Return next entry in host file. */ -- enum nss_status status = NSS_STATUS_SUCCESS; - -- __libc_lock_lock (lock); -- -- /* Be prepared that the set*ent function was not called before. */ -- if (stream == NULL) -- status = internal_setent (&stream); -- -- if (status == NSS_STATUS_SUCCESS) -- { -- result->alias_local = 1; -+ struct nss_files_per_file_data *data; -+ enum nss_status status = __nss_files_data_open (&data, nss_file_aliasent, -+ "/etc/aliases", errnop, NULL); -+ if (status != NSS_STATUS_SUCCESS) -+ return status; - -- /* Read lines until we get a definite result. */ -- do -- status = get_next_alias (stream, NULL, result, buffer, buflen, errnop); -- while (status == NSS_STATUS_RETURN); -- } -+ result->alias_local = 1; - -- __libc_lock_unlock (lock); -+ /* Read lines until we get a definite result. */ -+ do -+ status = get_next_alias (data->stream, NULL, result, buffer, buflen, -+ errnop); -+ while (status == NSS_STATUS_RETURN); - -+ __nss_files_data_put (data); - return status; - } -- -+libc_hidden_def (_nss_files_getaliasent_r) - - enum nss_status - _nss_files_getaliasbyname_r (const char *name, struct aliasent *result, -@@ -418,9 +381,10 @@ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result, - do - status = get_next_alias (stream, name, result, buffer, buflen, errnop); - while (status == NSS_STATUS_RETURN); -- } - -- internal_endent (&stream); -+ fclose (stream); -+ } - - return status; - } -+libc_hidden_def (_nss_files_getaliasbyname_r) -diff --git a/nss/nss_files/files-ethers.c b/nss/nss_files/files-ethers.c -index 2fe7f81e4b..7c2c2b9833 100644 ---- a/nss/nss_files/files-ethers.c -+++ b/nss/nss_files/files-ethers.c -@@ -20,8 +20,6 @@ - #include <netinet/if_ether.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - struct etherent_data {}; - - #define ENTNAME etherent -diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c -index 49be38e8b1..a716d948e2 100644 ---- a/nss/nss_files/files-grp.c -+++ b/nss/nss_files/files-grp.c -@@ -19,8 +19,6 @@ - #include <grp.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define STRUCTURE group - #define ENTNAME grent - #define DATABASE "group" -diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c -index 2b47ec3e53..d54d91d038 100644 ---- a/nss/nss_files/files-hosts.c -+++ b/nss/nss_files/files-hosts.c -@@ -26,8 +26,6 @@ - #include <alloc_buffer.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - /* Get implementation for some internal functions. */ - #include "../resolv/res_hconf.h" - -@@ -57,12 +55,13 @@ LINE_PARSER - STRING_FIELD (addr, isspace, 1); - - /* Parse address. */ -- if (inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr) -+ if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr) - > 0) - af = af == AF_UNSPEC ? AF_INET : af; - else - { -- if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) -+ if (af == AF_INET -+ && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0) - { - if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr)) - memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ); -@@ -76,7 +75,7 @@ LINE_PARSER - return 0; - } - else if (af == AF_UNSPEC -- && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) -+ && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0) - af = AF_INET6; - else - /* Illegal address: ignore line. */ -@@ -349,7 +348,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result, - status = gethostbyname3_multi - (stream, name, af, result, buffer, buflen, errnop, herrnop); - -- internal_endent (&stream); -+ fclose (stream); - } - - if (canonp && status == NSS_STATUS_SUCCESS) -@@ -357,6 +356,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result, - - return status; - } -+libc_hidden_def (_nss_files_gethostbyname3_r) - - enum nss_status - _nss_files_gethostbyname_r (const char *name, struct hostent *result, -@@ -366,6 +366,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result, - return _nss_files_gethostbyname3_r (name, AF_INET, result, buffer, buflen, - errnop, herrnop, NULL, NULL); - } -+libc_hidden_def (_nss_files_gethostbyname_r) - - enum nss_status - _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result, -@@ -375,6 +376,7 @@ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result, - return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen, - errnop, herrnop, NULL, NULL); - } -+libc_hidden_def (_nss_files_gethostbyname2_r) - - enum nss_status - _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, -@@ -475,7 +477,7 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, - status = NSS_STATUS_SUCCESS; - } - -- internal_endent (&stream); -+ fclose (stream); - } - else if (status == NSS_STATUS_TRYAGAIN) - { -@@ -490,3 +492,4 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, - - return status; - } -+libc_hidden_def (_nss_files_gethostbyname4_r) -diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c -index 717c9fd334..18ed288d04 100644 ---- a/nss/nss_files/files-init.c -+++ b/nss/nss_files/files-init.c -@@ -21,8 +21,7 @@ - #include <string.h> - #include <nscd/nscd.h> - #include <nss.h> -- --NSS_DECLARE_MODULE_FUNCTIONS (files) -+#include <nss_files.h> - - static void - register_file (void (*cb) (size_t, struct traced_file *), -@@ -49,5 +48,6 @@ _nss_files_init (void (*cb) (size_t, struct traced_file *)) - register_file (cb, servdb, "/etc/services", 0); - register_file (cb, netgrdb, "/etc/netgroup", 0); - } -+libc_hidden_def (_nss_files_init) - - #endif -diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c -index 6fcea40b55..b44211e50b 100644 ---- a/nss/nss_files/files-initgroups.c -+++ b/nss/nss_files/files-initgroups.c -@@ -28,8 +28,6 @@ - #include <nss.h> - #include <nss_files.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - enum nss_status - _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start, - long int *size, gid_t **groupsp, long int limit, -@@ -129,3 +127,4 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start, - - return status == NSS_STATUS_SUCCESS && !any ? NSS_STATUS_NOTFOUND : status; - } -+libc_hidden_def (_nss_files_initgroups_dyn) -diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c -index f8c821c2f0..75bfbd9e44 100644 ---- a/nss/nss_files/files-netgrp.c -+++ b/nss/nss_files/files-netgrp.c -@@ -28,11 +28,9 @@ - #include "netgroup.h" - #include <nss_files.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define DATAFILE "/etc/netgroup" - --libnss_files_hidden_proto (_nss_files_endnetgrent) -+libc_hidden_proto (_nss_files_endnetgrent) - - #define EXPAND(needed) \ - do \ -@@ -152,7 +150,7 @@ _nss_files_setnetgrent (const char *group, struct __netgrent *result) - - return status; - } -- -+libc_hidden_def (_nss_files_setnetgrent) - - enum nss_status - _nss_files_endnetgrent (struct __netgrent *result) -@@ -164,7 +162,7 @@ _nss_files_endnetgrent (struct __netgrent *result) - result->cursor = NULL; - return NSS_STATUS_SUCCESS; - } --libnss_files_hidden_def (_nss_files_endnetgrent) -+libc_hidden_def (_nss_files_endnetgrent) - - static char * - strip_whitespace (char *str) -@@ -279,7 +277,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result, - - return status; - } --libnss_files_hidden_def (_nss_netgroup_parseline) -+libc_hidden_def (_nss_netgroup_parseline) - - - enum nss_status -@@ -293,3 +291,4 @@ _nss_files_getnetgrent_r (struct __netgrent *result, char *buffer, - - return status; - } -+libc_hidden_def (_nss_files_getnetgrent_r) -diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c -index 9cd7d7dc79..217ed78609 100644 ---- a/nss/nss_files/files-network.c -+++ b/nss/nss_files/files-network.c -@@ -22,8 +22,6 @@ - #include <stdint.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define ENTNAME netent - #define DATABASE "networks" - #define NEED_H_ERRNO -@@ -71,7 +69,7 @@ LINE_PARSER - *cp = '\0'; - addr = newp; - } -- result->n_net = inet_network (addr); -+ result->n_net = inet_network (addr); - result->n_addrtype = AF_INET; - - }) -diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c -index 68c51c7cbf..997eac573a 100644 ---- a/nss/nss_files/files-parse.c -+++ b/nss/nss_files/files-parse.c -@@ -74,13 +74,7 @@ struct parser_data - /* Export the line parser function so it can be used in nss_db. */ - # define parser_stclass /* Global */ - # define parse_line CONCAT(_nss_files_parse_,ENTNAME) --# if IS_IN (libc) --/* We are defining one of the functions that actually lives in libc -- because it is used to implement fget*ent and suchlike. */ --# define nss_files_parse_hidden_def(name) libc_hidden_def (name) --# else --# define nss_files_parse_hidden_def(name) libnss_files_hidden_def (name) --# endif -+# define nss_files_parse_hidden_def(name) libc_hidden_def (name) - #endif - - -diff --git a/nss/nss_files/files-proto.c b/nss/nss_files/files-proto.c -index 98d082c642..13072692c1 100644 ---- a/nss/nss_files/files-proto.c -+++ b/nss/nss_files/files-proto.c -@@ -19,8 +19,6 @@ - #include <netdb.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define ENTNAME protoent - #define DATABASE "protocols" - -diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c -index b04165ddde..5c74c6da9b 100644 ---- a/nss/nss_files/files-pwd.c -+++ b/nss/nss_files/files-pwd.c -@@ -19,8 +19,6 @@ - #include <pwd.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define STRUCTURE passwd - #define ENTNAME pwent - #define DATABASE "passwd" -diff --git a/nss/nss_files/files-rpc.c b/nss/nss_files/files-rpc.c -index eeb2725d2c..3dea8f18f2 100644 ---- a/nss/nss_files/files-rpc.c -+++ b/nss/nss_files/files-rpc.c -@@ -19,8 +19,6 @@ - #include <rpc/netdb.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define ENTNAME rpcent - #define DATABASE "rpc" - -diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c -index f4f0985377..a8d83e094e 100644 ---- a/nss/nss_files/files-service.c -+++ b/nss/nss_files/files-service.c -@@ -20,8 +20,6 @@ - #include <netdb.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define ENTNAME servent - #define DATABASE "services" - -diff --git a/nss/nss_files/files-sgrp.c b/nss/nss_files/files-sgrp.c -index 6b1c9eac02..213a408e7b 100644 ---- a/nss/nss_files/files-sgrp.c -+++ b/nss/nss_files/files-sgrp.c -@@ -19,8 +19,6 @@ - #include <gshadow.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define STRUCTURE sgrp - #define ENTNAME sgent - #define DATABASE "gshadow" -diff --git a/nss/nss_files/files-spwd.c b/nss/nss_files/files-spwd.c -index 976deaf918..d031257a20 100644 ---- a/nss/nss_files/files-spwd.c -+++ b/nss/nss_files/files-spwd.c -@@ -19,8 +19,6 @@ - #include <shadow.h> - #include <nss.h> - --NSS_DECLARE_MODULE_FUNCTIONS (files) -- - #define STRUCTURE spwd - #define ENTNAME spent - #define DATABASE "shadow" -diff --git a/nss/nss_files_data.c b/nss/nss_files_data.c -new file mode 100644 -index 0000000000..80fbfe5fff ---- /dev/null -+++ b/nss/nss_files_data.c -@@ -0,0 +1,161 @@ -+/* Returns a pointer to the global nss_files data structure. -+ Copyright (C) 2021 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, see -+ <https://www.gnu.org/licenses/>. */ -+ -+#include <nss_files.h> -+ -+#include <allocate_once.h> -+#include <errno.h> -+#include <netdb.h> -+#include <nss.h> -+#include <stdlib.h> -+ -+/* This collects all per file-data. */ -+struct nss_files_data -+{ -+ struct nss_files_per_file_data files[nss_file_count]; -+}; -+ -+/* For use with allocate_once. */ -+static void *nss_files_global; -+static void * -+nss_files_global_allocate (void *closure) -+{ -+ struct nss_files_data *result = malloc (sizeof (*result)); -+ if (result != NULL) -+ { -+ for (int i = 0; i < nss_file_count; ++i) -+ { -+ result->files[i].stream = NULL; -+ __libc_lock_init (result->files[i].lock); -+ } -+ } -+ return result; -+} -+/* Like __nss_files_data_open, but does not perform the open call. */ -+static enum nss_status -+__nss_files_data_get (struct nss_files_per_file_data **pdata, -+ enum nss_files_file file, int *errnop, int *herrnop) -+{ -+ struct nss_files_data *data = allocate_once (&nss_files_global, -+ nss_files_global_allocate, -+ NULL, NULL); -+ if (data == NULL) -+ { -+ if (errnop != NULL) -+ *errnop = errno; -+ if (herrnop != NULL) -+ { -+ __set_h_errno (NETDB_INTERNAL); -+ *herrnop = NETDB_INTERNAL; -+ } -+ return NSS_STATUS_TRYAGAIN; -+ } -+ -+ *pdata = &data->files[file]; -+ __libc_lock_lock ((*pdata)->lock); -+ return NSS_STATUS_SUCCESS; -+} -+ -+/* Helper function for opening the backing file at PATH. */ -+static enum nss_status -+__nss_files_data_internal_open (struct nss_files_per_file_data *data, -+ const char *path) -+{ -+ enum nss_status status = NSS_STATUS_SUCCESS; -+ -+ if (data->stream == NULL) -+ { -+ data->stream = __nss_files_fopen (path); -+ -+ if (data->stream == NULL) -+ status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; -+ } -+ -+ return status; -+} -+ -+ -+enum nss_status -+__nss_files_data_open (struct nss_files_per_file_data **pdata, -+ enum nss_files_file file, const char *path, -+ int *errnop, int *herrnop) -+{ -+ enum nss_status status = __nss_files_data_get (pdata, file, errnop, herrnop); -+ if (status != NSS_STATUS_SUCCESS) -+ return status; -+ -+ /* Be prepared that the set*ent function was not called before. */ -+ if ((*pdata)->stream == NULL) -+ { -+ int saved_errno = errno; -+ status = __nss_files_data_internal_open (*pdata, path); -+ __set_errno (saved_errno); -+ if (status != NSS_STATUS_SUCCESS) -+ __nss_files_data_put (*pdata); -+ } -+ -+ return status; -+} -+ -+libc_hidden_def (__nss_files_data_open) -+ -+void -+__nss_files_data_put (struct nss_files_per_file_data *data) -+{ -+ __libc_lock_unlock (data->lock); -+} -+libc_hidden_def (__nss_files_data_put) -+ -+enum nss_status -+__nss_files_data_setent (enum nss_files_file file, const char *path) -+{ -+ struct nss_files_per_file_data *data; -+ enum nss_status status = __nss_files_data_get (&data, file, NULL, NULL); -+ if (status != NSS_STATUS_SUCCESS) -+ return status; -+ -+ if (data->stream == NULL) -+ status = __nss_files_data_internal_open (data, path); -+ else -+ rewind (data->stream); -+ -+ __nss_files_data_put (data); -+ return status; -+} -+libc_hidden_def (__nss_files_data_setent) -+ -+enum nss_status -+__nss_files_data_endent (enum nss_files_file file) -+{ -+ /* No cleanup is necessary if not initialized. */ -+ struct nss_files_data *data = atomic_load_acquire (&nss_files_global); -+ if (data == NULL) -+ return NSS_STATUS_SUCCESS; -+ -+ struct nss_files_per_file_data *fdata = &data->files[file]; -+ __libc_lock_lock (fdata->lock); -+ if (fdata->stream != NULL) -+ { -+ fclose (fdata->stream); -+ fdata->stream = NULL; -+ } -+ __libc_lock_unlock (fdata->lock); -+ -+ return NSS_STATUS_SUCCESS; -+} -+libc_hidden_def (__nss_files_data_endent) -diff --git a/nss/nss_files_functions.c b/nss/nss_files_functions.c -new file mode 100644 -index 0000000000..85720b4311 ---- /dev/null -+++ b/nss/nss_files_functions.c -@@ -0,0 +1,43 @@ -+/* Direct access for nss_files functions for NSS module loading. -+ Copyright (C) 2021 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, see -+ <https://www.gnu.org/licenses/>. */ -+ -+#include <nss_module.h> -+#include <nss_files.h> -+ -+void -+__nss_files_functions (nss_module_functions_untyped pointers) -+{ -+ void **fptr = pointers; -+ -+ /* Functions which are not implemented. */ -+#define _nss_files_getcanonname_r NULL -+#define _nss_files_gethostbyaddr2_r NULL -+#define _nss_files_getpublickey NULL -+#define _nss_files_getsecretkey NULL -+#define _nss_files_netname2user NULL -+ -+#undef DEFINE_NSS_FUNCTION -+#define DEFINE_NSS_FUNCTION(x) *fptr++ = _nss_files_##x; -+#include "function.def" -+ -+#ifdef PTR_MANGLE -+ void **end = fptr; -+ for (fptr = pointers; fptr != end; ++fptr) -+ PTR_MANGLE (*fptr); -+#endif -+} -diff --git a/nss/nss_module.c b/nss/nss_module.c -index 60c070c851..7b42c585a4 100644 ---- a/nss/nss_module.c -+++ b/nss/nss_module.c -@@ -30,6 +30,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -+#include <nss_files.h> - - /* Suffix after .so of NSS service modules. This is a bit of magic, - but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we -@@ -110,10 +111,45 @@ static const function_name nss_function_name_array[] = - #include "function.def" - }; - -+static bool -+module_load_nss_files (struct nss_module *module) -+{ -+ if (is_nscd) -+ { -+ void (*cb) (size_t, struct traced_file *) = nscd_init_cb; -+# ifdef PTR_DEMANGLE -+ PTR_DEMANGLE (cb); -+# endif -+ _nss_files_init (cb); -+ } -+ -+ /* Initialize the function pointers, following the double-checked -+ locking idiom. */ -+ __libc_lock_lock (nss_module_list_lock); -+ switch ((enum nss_module_state) atomic_load_acquire (&module->state)) -+ { -+ case nss_module_uninitialized: -+ case nss_module_failed: -+ __nss_files_functions (module->functions.untyped); -+ module->handle = NULL; -+ /* Synchronizes with unlocked __nss_module_load atomic_load_acquire. */ -+ atomic_store_release (&module->state, nss_module_loaded); -+ break; -+ case nss_module_loaded: -+ /* Nothing to clean up. */ -+ break; -+ } -+ __libc_lock_unlock (nss_module_list_lock); -+ return true; -+} -+ - /* Internal implementation of __nss_module_load. */ - static bool - module_load (struct nss_module *module) - { -+ if (strcmp (module->name, "files") == 0) -+ return module_load_nss_files (module); -+ - void *handle; - { - char *shlib_name; -@@ -360,7 +396,7 @@ __nss_module_freeres (void) - struct nss_module *current = nss_module_list; - while (current != NULL) - { -- if (current->state == nss_module_loaded) -+ if (current->state == nss_module_loaded && current->handle != NULL) - __libc_dlclose (current->handle); - - struct nss_module *next = current->next; -diff --git a/nss/nss_module.h b/nss/nss_module.h -index 05c4791d11..c1a1d90b60 100644 ---- a/nss/nss_module.h -+++ b/nss/nss_module.h -@@ -38,6 +38,10 @@ struct nss_module_functions - typedef void *nss_module_functions_untyped[sizeof (struct nss_module_functions) - / sizeof (void *)]; - -+/* Locate the nss_files functions, as if by dlopen/dlsym. */ -+void __nss_files_functions (nss_module_functions_untyped pointers) -+ attribute_hidden; -+ - /* Initialization state of a NSS module. */ - enum nss_module_state - { -diff --git a/nss/nss_readline.c b/nss/nss_readline.c -index 4b3ecbccc8..a2f397a11f 100644 ---- a/nss/nss_readline.c -+++ b/nss/nss_readline.c -@@ -40,7 +40,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset) - *poffset = __ftello64 (fp); - - buf[len - 1] = '\xff'; /* Marker to recognize truncation. */ -- if (fgets_unlocked (buf, len, fp) == NULL) -+ if (__fgets_unlocked (buf, len, fp) == NULL) - { - if (feof_unlocked (fp)) - { -@@ -61,7 +61,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset) - line on the next call. */ - return __nss_readline_seek (fp, *poffset); - -- /* fgets_unlocked succeeded. */ -+ /* __fgets_unlocked succeeded. */ - - /* Remove leading whitespace. */ - char *p = buf; -diff --git a/nss/nss.h b/nss/nss.h -index ae213f9a6c..c6d62adc0f 100644 ---- a/nss/nss.h -+++ b/nss/nss.h -@@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int); - extern nss_endgrent _nss_##module##_endgrent; \ - extern nss_endhostent _nss_##module##_endhostent; \ - extern nss_endnetent _nss_##module##_endnetent; \ -- extern nss_endnetgrent _nss_##module##__endnetgrent; \ -+ extern nss_endnetgrent _nss_##module##_endnetgrent; \ - extern nss_endprotoent _nss_##module##_endprotoent; \ - extern nss_endpwent _nss_##module##_endpwent; \ - extern nss_endrpcent _nss_##module##_endrpcent; \ -diff --git a/nss/nss_module.c b/nss/nss_module.c -index 7b42c585a4..7ea5ad9887 100644 ---- a/nss/nss_module.c -+++ b/nss/nss_module.c -@@ -114,14 +114,16 @@ static const function_name nss_function_name_array[] = - static bool - module_load_nss_files (struct nss_module *module) - { -+#ifdef USE_NSCD - if (is_nscd) - { - void (*cb) (size_t, struct traced_file *) = nscd_init_cb; --# ifdef PTR_DEMANGLE -+# ifdef PTR_DEMANGLE - PTR_DEMANGLE (cb); --# endif -+# endif - _nss_files_init (cb); - } -+#endif - - /* Initialize the function pointers, following the double-checked - locking idiom. */ diff --git a/gnu/packages/patches/gnupg-CVE-2022-34903.patch b/gnu/packages/patches/gnupg-CVE-2022-34903.patch deleted file mode 100644 index 19c055282a..0000000000 --- a/gnu/packages/patches/gnupg-CVE-2022-34903.patch +++ /dev/null @@ -1,54 +0,0 @@ -https://dev.gnupg.org/T6027 -https://www.openwall.com/lists/oss-security/2022/06/30/1 -https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=34c649b3601383cd11dbc76221747ec16fd68e1b - -From 34c649b3601383cd11dbc76221747ec16fd68e1b Mon Sep 17 00:00:00 2001 -From: Werner Koch <[email protected]> -Date: Tue, 14 Jun 2022 11:33:27 +0200 -Subject: [PATCH] g10: Fix garbled status messages in NOTATION_DATA - -* g10/cpr.c (write_status_text_and_buffer): Fix off-by-one --- - -Depending on the escaping and line wrapping the computed remaining -buffer length could be wrong. Fixed by always using a break to -terminate the escape detection loop. Might have happened for all -status lines which may wrap. - -GnuPG-bug-id: T6027 ---- - g10/cpr.c | 13 ++++--------- - 1 file changed, 4 insertions(+), 9 deletions(-) - -diff --git a/g10/cpr.c b/g10/cpr.c -index 9bfdd3c34..fa8005d6f 100644 ---- a/g10/cpr.c -+++ b/g10/cpr.c -@@ -372,20 +372,15 @@ write_status_text_and_buffer (int no, const char *string, - } - first = 0; - } -- for (esc=0, s=buffer, n=len; n && !esc; s++, n--) -+ for (esc=0, s=buffer, n=len; n; s++, n--) - { - if (*s == '%' || *(const byte*)s <= lower_limit - || *(const byte*)s == 127 ) - esc = 1; - if (wrap && ++count > wrap) -- { -- dowrap=1; -- break; -- } -- } -- if (esc) -- { -- s--; n++; -+ dowrap=1; -+ if (esc || dowrap) -+ break; - } - if (s != buffer) - es_fwrite (buffer, s-buffer, 1, statusfp); --- -2.11.0 - diff --git a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch deleted file mode 100644 index e04c945158..0000000000 --- a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch +++ /dev/null @@ -1,56 +0,0 @@ -Fixes <https://issues.guix.gnu.org/47867>. - -This fix was merged upstream -in <https://gitlab.com/gnutls/gnutls/-/merge_requests/1417> and will -be in GnuTLS 3.7.3. Upstream commit: - -commit 110e2172dbef1fbdf7399dab1e80780847b61c0c -Author: Ludovic Courtès <[email protected]> -Date: Sat Apr 24 22:02:14 2021 +0200 - - guile: Writes to record ports handle EAGAIN/EINTR transparently. - -diff --git a/guile/src/core.c b/guile/src/core.c -index a13670fc7b..0926dc8a97 100644 ---- a/guile/src/core.c -+++ b/guile/src/core.c -@@ -985,7 +985,10 @@ write_to_session_record_port (SCM port, const void *data, size_t size) - c_result = gnutls_record_send (c_session, (char *) data + c_sent, - size - c_sent); - if (EXPECT_FALSE (c_result < 0)) -- scm_gnutls_error (c_result, FUNC_NAME); -+ { -+ if (c_result != GNUTLS_E_AGAIN && c_result != GNUTLS_E_INTERRUPTED) -+ scm_gnutls_error (c_result, FUNC_NAME); -+ } - else - c_sent += c_result; - } -@@ -1069,7 +1072,8 @@ read_from_session_record_port (SCM port, SCM dst, size_t start, size_t count) - #undef FUNC_NAME - - /* Return the file descriptor that backs PORT. This function is called upon a -- blocking read--i.e., 'read_from_session_record_port' returned -1. */ -+ blocking read--i.e., 'read_from_session_record_port' or -+ 'write_to_session_record_port' returned -1. */ - static int - session_record_port_fd (SCM port) - { -@@ -1097,7 +1101,16 @@ write_to_session_record_port (SCM port, SCM src, size_t start, size_t count) - c_session = scm_to_gnutls_session (session, 1, FUNC_NAME); - data = (char *) SCM_BYTEVECTOR_CONTENTS (src) + start; - -- result = gnutls_record_send (c_session, data, count); -+ do -+ result = gnutls_record_send (c_session, data, count); -+ while (result == GNUTLS_E_INTERRUPTED -+ || (result == GNUTLS_E_AGAIN -+ && !SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session))); -+ -+ if (result == GNUTLS_E_AGAIN -+ && SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session)) -+ /* Tell Guile that reading would block. */ -+ return (size_t) -1; - - if (EXPECT_FALSE (result < 0)) - scm_gnutls_error (result, FUNC_NAME); diff --git a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch index 956fa617c3..8bb86467c0 100644 --- a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch +++ b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch @@ -1,11 +1,14 @@ -# Names of libraries included in typelib files are opened by dlopen. Here we -# add the full path. -# -# This patch was provided by Luca Bruno <[email protected]> for -# 'gobject-introspection' 1.40.0 in Nix. -# -# It has since been updated to work with newer versions of -# gobject-introspection. +Names of libraries included in typelib files are opened by dlopen. +Here we add the full path. + +This patch was provided by Luca Bruno <[email protected]>, +for 'gobject-introspection' 1.40.0 in Nix. + +It has since been updated to work with newer versions of +gobject-introspection. + +diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py +index 1d39ab84..e12ed24e 100644 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -95,6 +95,39 @@ def get_windows_option_group(parser): @@ -48,10 +51,10 @@ def _get_option_parser(): parser = optparse.OptionParser('%prog [options] sources', version='%prog ' + giscanner.__version__) -@@ -205,6 +238,10 @@ match the namespace prefix.""") - parser.add_option("", "--filelist", - action="store", dest="filelist", default=[], - help="file containing headers and sources to be scanned") +@@ -220,6 +253,10 @@ match the namespace prefix.""") + parser.add_option("", "--compiler", + action="store", dest="compiler", default=None, + help="the C compiler to use internally") + parser.add_option("", "--fallback-library-path", + action="store", dest="fallback_libpath", + default=_get_default_fallback_libpath(), @@ -59,6 +62,8 @@ group = get_preprocessor_option_group(parser) parser.add_option_group(group) +diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py +index 9f8ab5df..8aa37c99 100644 --- a/giscanner/shlibs.py +++ b/giscanner/shlibs.py @@ -57,6 +57,14 @@ def _ldd_library_pattern(library_name): @@ -76,7 +81,7 @@ # This is a what we do for non-la files. We assume that we are on an # ELF-like system where ldd exists and the soname extracted with ldd is # a filename that can be opened with dlopen(). -@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries): +@@ -108,7 +116,8 @@ def _resolve_non_libtool(options, binary, libraries): output = output.decode("utf-8", "replace") shlibs = resolve_from_ldd_output(libraries, output) @@ -86,7 +91,7 @@ def sanitize_shlib_path(lib): -@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib): +@@ -117,19 +126,18 @@ def sanitize_shlib_path(lib): # In case we get relative paths on macOS (like @rpath) then we fall # back to the basename as well: # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222 @@ -111,7 +116,7 @@ if len(patterns) == 0: return [] -@@ -139,8 +145,12 @@ def resolve_from_ldd_output(libraries, output): +@@ -141,8 +149,12 @@ def resolve_from_ldd_output(libraries, output): if line.endswith(':'): continue for word in line.split(): @@ -126,10 +131,11 @@ if m: del patterns[library] shlibs.append(m.group()) - +diff --git a/giscanner/utils.py b/giscanner/utils.py +index 31c7ea48..630002a8 100644 --- a/giscanner/utils.py +++ b/giscanner/utils.py -@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file): +@@ -114,16 +114,11 @@ def extract_libtool_shlib(la_file): if dlname is None: return None @@ -141,8 +147,7 @@ - if libdir is None: - return dlbasename - return libdir + '/' + dlbasename -- # From the comments in extract_libtool(), older libtools had -- # a path rather than the raw dlname +- # Older libtools had a path rather than the raw dlname - return os.path.basename(dlname) + dlbasename = os.path.basename(dlname) + libdir = _extract_libdir_field(la_file) @@ -151,10 +156,12 @@ + return libdir + '/' + dlbasename - def extract_libtool(la_file): + # Returns arguments for invoking libtool, if applicable, otherwise None +diff --git a/tests/scanner/test_shlibs.py b/tests/scanner/test_shlibs.py +index a8337c60..7f123103 100644 --- a/tests/scanner/test_shlibs.py +++ b/tests/scanner/test_shlibs.py -@@ -40,6 +64,7 @@ class TestLddParser(unittest.TestCase): +@@ -40,7 +40,8 @@ class TestLddParser(unittest.TestCase): self.assertEqual( sanitize_shlib_path('/foo/bar'), @@ -163,4 +170,4 @@ + '/foo/bar') def test_unresolved_library(self): -output = '' + output = '' diff --git a/gnu/packages/patches/gobject-introspection-cc.patch b/gnu/packages/patches/gobject-introspection-cc.patch index 6a86b56b44..d3b1df82af 100644 --- a/gnu/packages/patches/gobject-introspection-cc.patch +++ b/gnu/packages/patches/gobject-introspection-cc.patch @@ -1,12 +1,13 @@ Use gcc as the default C compiler if CC is not set. -diff -ru gobject-introspection-1.58.1.orig/giscanner/__init__.py gobject-introspection-1.58.1/giscanner/__init__.py ---- gobject-introspection-1.58.1.orig/giscanner/__init__.py 1970-01-01 01:00:00.000000000 +0100 -+++ gobject-introspection-1.58.1/giscanner/__init__.py 2018-12-03 13:33:28.788971299 +0100 -@@ -22,6 +22,8 @@ +diff --git a/giscanner/__init__.py b/giscanner/__init__.py +index 7c2f365a..607fe341 100644 +--- a/giscanner/__init__.py ++++ b/giscanner/__init__.py +@@ -21,6 +21,8 @@ import os builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR') if builddir is not None: - __path__.append(os.path.join(builddir, 'giscanner')) + __path__.append(os.path.join(builddir, 'giscanner')) # type: ignore # mypy issue #1422 +if not 'CC' in os.environ: + os.environ['CC'] = 'gcc' try: diff --git a/gnu/packages/patches/guile-cross-compilation.patch b/gnu/packages/patches/guile-cross-compilation.patch new file mode 100644 index 0000000000..a594cb9421 --- /dev/null +++ b/gnu/packages/patches/guile-cross-compilation.patch @@ -0,0 +1,55 @@ +When cross-compiling, get type sizes of the host system, not the build system. + +This is Guile commit 24b30130ca75653bdbacea84ce0443608379d630, which +fixes <https://issues.guix.gnu.org/54198>, with one difference: it uses +8 instead of SIZEOF_INTMAX_T, such that we do not need to modify +'configure.ac' to check for the size of 'intmax_t' and to run 'autoreconf' +(libguile/numbers.c expects SCM_SIZEOF_INTMAX_T = 8). + +diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c +index 01b14f14d..691ebd0af 100644 +--- a/libguile/gen-scmconfig.c ++++ b/libguile/gen-scmconfig.c +@@ -1,4 +1,4 @@ +-/* Copyright 2003-2013,2018,2020,2021 ++/* Copyright 2003-2013, 2018, 2020-2022 + Free Software Foundation, Inc. + + This file is part of Guile. +@@ -238,21 +238,21 @@ main (int argc, char *argv[]) + pf ("\n"); + pf ("/* Standard types. */\n"); + +- pf ("#define SCM_SIZEOF_CHAR %zu\n", sizeof (char)); +- pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %zu\n", sizeof (unsigned char)); +- pf ("#define SCM_SIZEOF_SHORT %zu\n", sizeof (short)); +- pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %zu\n", sizeof (unsigned short)); +- pf ("#define SCM_SIZEOF_LONG %zu\n", sizeof (long)); +- pf ("#define SCM_SIZEOF_UNSIGNED_LONG %zu\n", sizeof (unsigned long)); +- pf ("#define SCM_SIZEOF_INT %zu\n", sizeof (int)); +- pf ("#define SCM_SIZEOF_UNSIGNED_INT %zu\n", sizeof (unsigned int)); +- pf ("#define SCM_SIZEOF_SIZE_T %zu\n", sizeof (size_t)); +- pf ("#define SCM_SIZEOF_LONG_LONG %zu\n", sizeof (long long)); +- pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %zu\n", sizeof (unsigned long long)); +- pf ("#define SCM_SIZEOF_INTMAX %zu\n", sizeof (intmax_t)); +- pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %zu\n", sizeof (ptrdiff_t)); +- pf ("#define SCM_SIZEOF_INTPTR_T %zu\n", sizeof (intptr_t)); +- pf ("#define SCM_SIZEOF_UINTPTR_T %zu\n", sizeof (uintptr_t)); ++ pf ("#define SCM_SIZEOF_CHAR %d\n", SIZEOF_CHAR); ++ pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %d\n", SIZEOF_UNSIGNED_CHAR); ++ pf ("#define SCM_SIZEOF_SHORT %d\n", SIZEOF_SHORT); ++ pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %d\n", SIZEOF_UNSIGNED_SHORT); ++ pf ("#define SCM_SIZEOF_LONG %d\n", SIZEOF_LONG); ++ pf ("#define SCM_SIZEOF_UNSIGNED_LONG %d\n", SIZEOF_UNSIGNED_LONG); ++ pf ("#define SCM_SIZEOF_INT %d\n", SIZEOF_INT); ++ pf ("#define SCM_SIZEOF_UNSIGNED_INT %d\n", SIZEOF_UNSIGNED_INT); ++ pf ("#define SCM_SIZEOF_SIZE_T %d\n", SIZEOF_SIZE_T); ++ pf ("#define SCM_SIZEOF_LONG_LONG %d\n", SIZEOF_LONG_LONG); ++ pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %d\n", SIZEOF_UNSIGNED_LONG_LONG); ++ pf ("#define SCM_SIZEOF_INTMAX %d\n", 8); /* like SIZEOF_INTMAX_T */ ++ pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %d\n", SIZEOF_PTRDIFF_T); ++ pf ("#define SCM_SIZEOF_INTPTR_T %d\n", SIZEOF_INTPTR_T); ++ pf ("#define SCM_SIZEOF_UINTPTR_T %d\n", SIZEOF_UINTPTR_T); + + pf ("\n"); + pf ("/* same as POSIX \"struct timespec\" -- always defined */\n"); diff --git a/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch b/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch new file mode 100644 index 0000000000..deb305bd96 --- /dev/null +++ b/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch @@ -0,0 +1,36 @@ +Avoid ordered comparison of pointer with integer to prevent compile error +with GCC 11. + +diff --git a/src/share/vm/opto/lcm.cpp b/src/share/vm/opto/lcm.cpp +--- a/src/share/vm/opto/lcm.cpp ++++ b/src/share/vm/opto/lcm.cpp +@@ -60,7 +60,7 @@ + // Check whether val is not-null-decoded compressed oop, + // i.e. will grab into the base of the heap if it represents NULL. + static bool accesses_heap_base_zone(Node *val) { +- if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops. ++ if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops. + if (val && val->is_Mach()) { + if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) { + // This assumes all Decodes with TypePtr::NotNull are matched to nodes that +diff --git a/src/share/vm/runtime/virtualspace.cpp b/src/share/vm/runtime/virtualspace.cpp +--- a/src/share/vm/runtime/virtualspace.cpp ++++ b/src/share/vm/runtime/virtualspace.cpp +@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, + (UseCompressedOops && (Universe::narrow_oop_base() != NULL) && + Universe::narrow_oop_use_implicit_null_checks()) ? + lcm(os::vm_page_size(), alignment) : 0) { +- if (base() > 0) { ++ if (base() != NULL) { + MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); + } + +@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size, + (UseCompressedOops && (Universe::narrow_oop_base() != NULL) && + Universe::narrow_oop_use_implicit_null_checks()) ? + lcm(os::vm_page_size(), prefix_align) : 0) { +- if (base() > 0) { ++ if (base() != NULL) { + MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); + } + diff --git a/gnu/packages/patches/inkscape-poppler-compat.patch b/gnu/packages/patches/inkscape-poppler-compat.patch new file mode 100644 index 0000000000..cb7d1c8eb3 --- /dev/null +++ b/gnu/packages/patches/inkscape-poppler-compat.patch @@ -0,0 +1,45 @@ +Fix build with Poppler 22.9.0. + +Taken from upstream: + + https://gitlab.com/inkscape/inkscape/-/commit/fb00794923d19cfbb2ca4adca3ae8971553a06be + +diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp +index cca1e840966c7940a1af472025535042b07e3e0f..80d64c9b866d5d3dd095636a9a02571b89061af1 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.cpp ++++ b/src/extension/internal/pdfinput/pdf-parser.cpp +@@ -697,7 +697,11 @@ void PdfParser::opSetDash(Object args[], int /*numArgs*/) + _POPPLER_FREE(obj); + } + } ++#if POPPLER_CHECK_VERSION(22, 9, 0) ++ state->setLineDash(std::vector<double> (dash, dash + length), args[1].getNum()); ++#else + state->setLineDash(dash, length, args[1].getNum()); ++#endif + builder->updateStyle(state); + } + +diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp +index 12f71dd9214b95dbad6fdf7642a96cdd57f2c64a..9fc56fe63c2feee986ad1ff5018e679a0bacb665 100644 +--- a/src/extension/internal/pdfinput/svg-builder.cpp ++++ b/src/extension/internal/pdfinput/svg-builder.cpp +@@ -389,10 +389,17 @@ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, GfxState *state) { + sp_repr_css_set_property(css, "stroke-miterlimit", os_ml.str().c_str()); + + // Line dash +- double *dash_pattern; + int dash_length; + double dash_start; ++#if POPPLER_CHECK_VERSION(22, 9, 0) ++ const double *dash_pattern; ++ const std::vector<double> &dash = state->getLineDash(&dash_start); ++ dash_pattern = dash.data(); ++ dash_length = dash.size(); ++#else ++ double *dash_pattern; + state->getLineDash(&dash_pattern, &dash_length, &dash_start); ++#endif + if ( dash_length > 0 ) { + Inkscape::CSSOStringStream os_array; + for ( int i = 0 ; i < dash_length ; i++ ) { diff --git a/gnu/packages/patches/jsoncpp-pkg-config-version.patch b/gnu/packages/patches/jsoncpp-pkg-config-version.patch deleted file mode 100644 index 3983cc300c..0000000000 --- a/gnu/packages/patches/jsoncpp-pkg-config-version.patch +++ /dev/null @@ -1,24 +0,0 @@ -Taken from upstream: https://github.com/open-source-parsers/jsoncpp/issues/1235. - -From ac2870298ed5b5a96a688d9df07461b31f83e906 Mon Sep 17 00:00:00 2001 -From: Derick Vigne <[email protected]> -Date: Tue, 26 Jan 2021 14:59:12 -0500 -Subject: [PATCH] Fixed pkg-config Version - ---- - pkg-config/jsoncpp.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pkg-config/jsoncpp.pc.in b/pkg-config/jsoncpp.pc.in -index 632a377f5..2a2221069 100644 ---- a/pkg-config/jsoncpp.pc.in -+++ b/pkg-config/jsoncpp.pc.in -@@ -5,7 +5,7 @@ includedir=@includedir_for_pc_file@ - - Name: jsoncpp - Description: A C++ library for interacting with JSON --Version: @JSONCPP_VERSION@ -+Version: @PROJECT_VERSION@ - URL: https://github.com/open-source-parsers/jsoncpp - Libs: -L${libdir} -ljsoncpp - Cflags: -I${includedir} diff --git a/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch b/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch deleted file mode 100644 index 971ed26180..0000000000 --- a/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch +++ /dev/null @@ -1,138 +0,0 @@ -This is a combination of the following 4 commits: -https://github.com/libffi/libffi/commit/01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch -https://github.com/libffi/libffi/commit/6663047f56c2932a6b10a790f4ac6666dd181326.patch -https://github.com/libffi/libffi/commit/e50b9ef8b910fa642ef158f6642e60d54d7ad740.patch -https://github.com/libffi/libffi/commit/4d6d2866ae43e55325e8ee96561221804602cd7a.patch - -From 2dbfa92a95e3bacabca431b89d2a5925e48a0e40 Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <[email protected]> -Date: Thu, 28 Nov 2019 12:42:41 +0000 - -powerpc: fix build failure on power7 and older (#532) - -Build failure looks as: -``` -libtool: compile: powerpc-unknown-linux-gnu-gcc \ - -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ... -In file included from src/powerpc/ffi.c:33: -src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target - 65 | typedef __int128 float128; - | ^~~~~~~~ -``` - -The fix avoids using __int128 in favour of aligned char[16]. - -Closes: https://github.com/libffi/libffi/issues/531 -Signed-off-by: Sergei Trofimovich <[email protected]> - -Address platforms with no __int128. - -powerpc64: Use memcpy to help platforms with no __int128. (#534) - -Signed-off-by: Khem Raj <[email protected]> - -Update powerpc sysv assembly for ffi_powerpc.h changes (#541) - -Some of the flag bits were moved when adding powerpc64 vector support. - -Fixes #536 ---- - src/powerpc/ffi_linux64.c | 12 ++++++------ - src/powerpc/ffi_powerpc.h | 2 +- - src/powerpc/sysv.S | 12 +++++------- - 3 files changed, 12 insertions(+), 14 deletions(-) - -diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c -index de0d033..4d50878 100644 ---- a/src/powerpc/ffi_linux64.c -+++ b/src/powerpc/ffi_linux64.c -@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) - if (next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) -- *vec_base.f128++ = **p_argv.f128; -+ memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); - else -- *next_arg.f128 = **p_argv.f128; -+ memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); - if (++next_arg.f128 == gpr_end.f128) - next_arg.f128 = rest.f128; - vecarg_count++; -@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) - { - if (vecarg_count < NUM_VEC_ARG_REGISTERS64 - && i < nfixedargs) -- *vec_base.f128++ = *arg.f128++; -+ memcpy (vec_base.f128++, arg.f128, sizeof (float128)); - else -- *next_arg.f128 = *arg.f128++; -+ memcpy (next_arg.f128, arg.f128++, sizeof (float128)); - if (++next_arg.f128 == gpr_end.f128) - next_arg.f128 = rest.f128; - vecarg_count++; -@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif, - do - { - if (pvec < end_pvec && i < nfixedargs) -- *to.f128 = *pvec++; -+ memcpy (to.f128, pvec++, sizeof (float128)); - else -- *to.f128 = *from.f128; -+ memcpy (to.f128, from.f128, sizeof (float128)); - to.f128++; - from.f128++; - } -diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h -index 5ee2a70..8e2f2f0 100644 ---- a/src/powerpc/ffi_powerpc.h -+++ b/src/powerpc/ffi_powerpc.h -@@ -62,7 +62,7 @@ typedef _Float128 float128; - #elif defined(__FLOAT128__) - typedef __float128 float128; - #else --typedef __int128 float128; -+typedef char float128[16] __attribute__((aligned(16))); - #endif - - void FFI_HIDDEN ffi_closure_SYSV (void); -diff --git a/src/powerpc/sysv.S b/src/powerpc/sysv.S -index 1474ce7..df97734 100644 ---- a/src/powerpc/sysv.S -+++ b/src/powerpc/sysv.S -@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV) - bctrl - - /* Now, deal with the return value. */ -- mtcrf 0x01,%r31 /* cr7 */ -+ mtcrf 0x03,%r31 /* cr6-cr7 */ - bt- 31,L(small_struct_return_value) - bt- 30,L(done_return_value) - #ifndef __NO_FPRS__ - bt- 29,L(fp_return_value) - #endif - stw %r3,0(%r30) -- bf+ 28,L(done_return_value) -+ bf+ 27,L(done_return_value) - stw %r4,4(%r30) -- mtcrf 0x02,%r31 /* cr6 */ -- bf 27,L(done_return_value) -+ bf 26,L(done_return_value) - stw %r5,8(%r30) - stw %r6,12(%r30) - /* Fall through... */ -@@ -145,10 +144,9 @@ L(done_return_value): - #ifndef __NO_FPRS__ - L(fp_return_value): - .cfi_restore_state -- bf 28,L(float_return_value) -+ bf 27,L(float_return_value) - stfd %f1,0(%r30) -- mtcrf 0x02,%r31 /* cr6 */ -- bf 27,L(done_return_value) -+ bf 26,L(done_return_value) - stfd %f2,8(%r30) - b L(done_return_value) - L(float_return_value): --- -2.26.0 - diff --git a/gnu/packages/patches/libffi-float128-powerpc64le.patch b/gnu/packages/patches/libffi-float128-powerpc64le.patch deleted file mode 100644 index 4fd32b0102..0000000000 --- a/gnu/packages/patches/libffi-float128-powerpc64le.patch +++ /dev/null @@ -1,58 +0,0 @@ -From de93adfb6f48100946bba2c3abad2a77a0cfde0b Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <[email protected]> -Date: Sun, 24 Nov 2019 09:52:01 +0100 -Subject: [PATCH] ffi_powerpc.h: fix build failure with powerpc7 - -This is a patch pulled down from the following: -https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch - -This issue is being hit on OpenBMC code when pulling the latest -libffi tag and building on a P8 ppc64le machine. I verified this -patch fixes the issue we are seeing. - -Below is the original commit message: - -Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7 -fails on: - -In file included from ../src/powerpc/ffi.c:33:0: -../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target - typedef _Float128 float128; - ^~~~~~~~~ - -Fix this build failure by checking for __HAVE_FLOAT128 before using -_Float128, as _Float128 is enabled only on specific conditions, see -output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h: - - /* Defined to 1 if the current compiler invocation provides a - floating-point type with the IEEE 754 binary128 format, and this glibc - includes corresponding *f128 interfaces for it. */ - #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ - && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH - # define __HAVE_FLOAT128 1 - #else - # define __HAVE_FLOAT128 0 - #endif - -Fixes: - - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53 - -Signed-off-by: Fabrice Fontaine <[email protected]> -Signed-off-by: Andrew Geissler <[email protected]> ---- - src/powerpc/ffi_powerpc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h -index 8e2f2f0e..960a5c42 100644 ---- a/src/powerpc/ffi_powerpc.h -+++ b/src/powerpc/ffi_powerpc.h -@@ -57,7 +57,7 @@ typedef union - double d; - } ffi_dblfl; - --#if defined(__FLOAT128_TYPE__) -+#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128) - typedef _Float128 float128; - #elif defined(__FLOAT128__) - typedef __float128 float128; diff --git a/gnu/packages/patches/libssh2-CVE-2019-17498.patch b/gnu/packages/patches/libssh2-CVE-2019-17498.patch deleted file mode 100644 index 6f69e562e2..0000000000 --- a/gnu/packages/patches/libssh2-CVE-2019-17498.patch +++ /dev/null @@ -1,126 +0,0 @@ -https://github.com/libssh2/libssh2/commit/dedcbd106f8e52d5586b0205bc7677e4c9868f9c.patch - -From dedcbd106f8e52d5586b0205bc7677e4c9868f9c Mon Sep 17 00:00:00 2001 -From: Will Cosgrove <[email protected]> -Date: Fri, 30 Aug 2019 09:57:38 -0700 -Subject: [PATCH] packet.c: improve message parsing (#402) - -* packet.c: improve parsing of packets - -file: packet.c - -notes: -Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST. ---- - src/packet.c | 68 ++++++++++++++++++++++------------------------------ - 1 file changed, 29 insertions(+), 39 deletions(-) - -diff --git a/src/packet.c b/src/packet.c -index 38ab62944..2e01bfc5d 100644 ---- a/src/packet.c -+++ b/src/packet.c -@@ -419,8 +419,8 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, - size_t datalen, int macstate) - { - int rc = 0; -- char *message = NULL; -- char *language = NULL; -+ unsigned char *message = NULL; -+ unsigned char *language = NULL; - size_t message_len = 0; - size_t language_len = 0; - LIBSSH2_CHANNEL *channelp = NULL; -@@ -472,33 +472,23 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, - - case SSH_MSG_DISCONNECT: - if(datalen >= 5) { -- size_t reason = _libssh2_ntohu32(data + 1); -+ uint32_t reason = 0; -+ struct string_buf buf; -+ buf.data = (unsigned char *)data; -+ buf.dataptr = buf.data; -+ buf.len = datalen; -+ buf.dataptr++; /* advance past type */ - -- if(datalen >= 9) { -- message_len = _libssh2_ntohu32(data + 5); -+ _libssh2_get_u32(&buf, &reason); -+ _libssh2_get_string(&buf, &message, &message_len); -+ _libssh2_get_string(&buf, &language, &language_len); - -- if(message_len < datalen-13) { -- /* 9 = packet_type(1) + reason(4) + message_len(4) */ -- message = (char *) data + 9; -- -- language_len = -- _libssh2_ntohu32(data + 9 + message_len); -- language = (char *) data + 9 + message_len + 4; -- -- if(language_len > (datalen-13-message_len)) { -- /* bad input, clear info */ -- language = message = NULL; -- language_len = message_len = 0; -- } -- } -- else -- /* bad size, clear it */ -- message_len = 0; -- } - if(session->ssh_msg_disconnect) { -- LIBSSH2_DISCONNECT(session, reason, message, -- message_len, language, language_len); -+ LIBSSH2_DISCONNECT(session, reason, (const char *)message, -+ message_len, (const char *)language, -+ language_len); - } -+ - _libssh2_debug(session, LIBSSH2_TRACE_TRANS, - "Disconnect(%d): %s(%s)", reason, - message, language); -@@ -539,24 +529,24 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, - int always_display = data[1]; - - if(datalen >= 6) { -- message_len = _libssh2_ntohu32(data + 2); -- -- if(message_len <= (datalen - 10)) { -- /* 6 = packet_type(1) + display(1) + message_len(4) */ -- message = (char *) data + 6; -- language_len = _libssh2_ntohu32(data + 6 + -- message_len); -- -- if(language_len <= (datalen - 10 - message_len)) -- language = (char *) data + 10 + message_len; -- } -+ struct string_buf buf; -+ buf.data = (unsigned char *)data; -+ buf.dataptr = buf.data; -+ buf.len = datalen; -+ buf.dataptr += 2; /* advance past type & always display */ -+ -+ _libssh2_get_string(&buf, &message, &message_len); -+ _libssh2_get_string(&buf, &language, &language_len); - } - - if(session->ssh_msg_debug) { -- LIBSSH2_DEBUG(session, always_display, message, -- message_len, language, language_len); -+ LIBSSH2_DEBUG(session, always_display, -+ (const char *)message, -+ message_len, (const char *)language, -+ language_len); - } - } -+ - /* - * _libssh2_debug will actually truncate this for us so - * that it's not an inordinate about of data -@@ -579,7 +569,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, - uint32_t len = 0; - unsigned char want_reply = 0; - len = _libssh2_ntohu32(data + 1); -- if(datalen >= (6 + len)) { -+ if((len <= (UINT_MAX - 6)) && (datalen >= (6 + len))) { - want_reply = data[5 + len]; - _libssh2_debug(session, - LIBSSH2_TRACE_CONN, diff --git a/gnu/packages/patches/libtiff-CVE-2022-34526.patch b/gnu/packages/patches/libtiff-CVE-2022-34526.patch new file mode 100644 index 0000000000..a5ad9d79a5 --- /dev/null +++ b/gnu/packages/patches/libtiff-CVE-2022-34526.patch @@ -0,0 +1,22 @@ +Fix CVE-2022-34526: + + https://nvd.nist.gov/vuln/detail/CVE-2022-34526 + https://gitlab.com/libtiff/libtiff/-/issues/433 + +Patch taken from upstream source repository: + + https://gitlab.com/libtiff/libtiff/-/commit/275735d0354e39c0ac1dc3c0db2120d6f31d1990 + +diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c +--- a/libtiff/tif_dirinfo.c ++++ b/libtiff/tif_dirinfo.c +@@ -1191,6 +1191,9 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag) + default: + return 1; + } ++ if( !TIFFIsCODECConfigured(tif->tif_dir.td_compression) ) { ++ return 0; ++ } + /* Check if codec specific tags are allowed for the current + * compression scheme (codec) */ + switch (tif->tif_dir.td_compression) { diff --git a/gnu/packages/patches/libtool-grep-compat.patch b/gnu/packages/patches/libtool-grep-compat.patch new file mode 100644 index 0000000000..46e5c6873d --- /dev/null +++ b/gnu/packages/patches/libtool-grep-compat.patch @@ -0,0 +1,51 @@ +Don't escape forward slashes to prevent a warning from grep 3.8. + +diff --git a/tests/link-order.at b/tests/link-order.at +--- a/tests/link-order.at ++++ b/tests/link-order.at +@@ -99,12 +99,12 @@ aix* | interix*) ;; # These systems have different path syntax + case $hardcode_direct$hardcode_direct_absolute in + yesno) + AT_CHECK([if $EGREP relinking stderr; then +- $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout ++ $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout + else :; fi], [0], [ignore], [], [echo "wrong link order"]) + ;; + *) + AT_CHECK([if $EGREP relinking stderr; then +- $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout ++ $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout + else :; fi], [0], [ignore], [], [echo "wrong link order"]) + ;; + esac +diff --git a/tests/testsuite b/tests/testsuite +--- a/tests/testsuite ++++ b/tests/testsuite +@@ -20611,11 +20611,11 @@ aix* | interix*) ;; # These systems have different path syntax + yesno) + { set +x + $as_echo "$at_srcdir/link-order.at:101: if \$EGREP relinking stderr; then +- \$EGREP \" .*\\/new\\/lib/libb\$shared_ext .*\\/old\\/lib/libcee\$shared_ext\" stdout ++ \$EGREP \" .*/new/lib/libb\$shared_ext .*/old/lib/libcee\$shared_ext\" stdout + else :; fi" + at_fn_check_prepare_notrace 'an embedded newline' "link-order.at:101" + ( $at_check_trace; if $EGREP relinking stderr; then +- $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout ++ $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout + else :; fi + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -20633,11 +20633,11 @@ $at_traceon; } + *) + { set +x + $as_echo "$at_srcdir/link-order.at:106: if \$EGREP relinking stderr; then +- \$EGREP \" -L.*\\/new\\/lib -lb -L.*\\/old\\/lib -lcee\" stdout ++ \$EGREP \" -L.*/new\\/lib -lb -L.*/old/lib -lcee\" stdout + else :; fi" + at_fn_check_prepare_notrace 'an embedded newline' "link-order.at:106" + ( $at_check_trace; if $EGREP relinking stderr; then +- $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout ++ $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout + else :; fi + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch index 3f86191b4f..91beaa903e 100644 --- a/gnu/packages/patches/libtool-skip-tests2.patch +++ b/gnu/packages/patches/libtool-skip-tests2.patch @@ -16,7 +16,7 @@ Skip the nopic test on ARM, MIPS and RISC-V systems. @@ -8741,7 +8741,7 @@ { set +x - $as_echo "$at_srcdir/demo.at:535: case \$host in + $as_echo "$at_srcdir/demo.at:513: case \$host in -hppa*|x86_64*|s390*) +hppa*|x86_64*|s390*|arm*|mips*|riscv*) # These hosts cannot use non-PIC shared libs @@ -24,7 +24,7 @@ Skip the nopic test on ARM, MIPS and RISC-V systems. *-solaris*|*-sunos*) @@ -8766,7 +8766,7 @@ " - at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535" + at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:513" ( $at_check_trace; case $host in -hppa*|x86_64*|s390*) +hppa*|x86_64*|s390*|arm*|mips*|riscv*) diff --git a/gnu/packages/patches/libwpd-gcc-compat.patch b/gnu/packages/patches/libwpd-gcc-compat.patch new file mode 100644 index 0000000000..ee206beafe --- /dev/null +++ b/gnu/packages/patches/libwpd-gcc-compat.patch @@ -0,0 +1,17 @@ +Fix build with newer GCC. + +Taken from upstream: + + https://sourceforge.net/p/libwpd/code/ci/333c8a26f231bea26ec3d56245315041bbf5577f/ + +--- a/src/lib/WPXTable.h ++++ b/src/lib/WPXTable.h +@@ -53,7 +53,7 @@ + ~WPXTable(); + void insertRow(); + void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits); +- const WPXTableCell *getCell(size_t i, size_t j) ++ const WPXTableCell *getCell(std::size_t i, std::size_t j) + { + return &(m_tableRows[i])[j]; + } diff --git a/gnu/packages/patches/libxml2-parent-pointers.patch b/gnu/packages/patches/libxml2-parent-pointers.patch deleted file mode 100644 index 1f0615c512..0000000000 --- a/gnu/packages/patches/libxml2-parent-pointers.patch +++ /dev/null @@ -1,228 +0,0 @@ -Fix a regression in 2.9.12 where some corrupt XML structures were handled -incorrectly: - - https://gitlab.gnome.org/GNOME/libxml2/-/issues/255 - -This is an amalgamation of these upstream commits: - - https://gitlab.gnome.org/GNOME/libxml2/-/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f - https://gitlab.gnome.org/GNOME/libxml2/-/commit/13ad8736d294536da4cbcd70a96b0a2fbf47070c - -diff --git a/HTMLtree.c b/HTMLtree.c ---- a/HTMLtree.c -+++ b/HTMLtree.c -@@ -744,7 +744,7 @@ void - htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED, - int format) { -- xmlNodePtr root; -+ xmlNodePtr root, parent; - xmlAttrPtr attr; - const htmlElemDesc * info; - -@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - } - - root = cur; -+ parent = cur->parent; - while (1) { - switch (cur->type) { - case XML_HTML_DOCUMENT_NODE: -@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - if (((xmlDocPtr) cur)->intSubset != NULL) { - htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL); - } -- if (cur->children != NULL) { -+ /* Always validate cur->parent when descending. */ -+ if ((cur->parent == parent) && (cur->children != NULL)) { -+ parent = cur; - cur = cur->children; - continue; - } - break; - - case XML_ELEMENT_NODE: -+ /* -+ * Some users like lxml are known to pass nodes with a corrupted -+ * tree structure. Fall back to a recursive call to handle this -+ * case. -+ */ -+ if ((cur->parent != parent) && (cur->children != NULL)) { -+ htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); -+ break; -+ } -+ - /* - * Get specific HTML info for that node. - */ -@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - (cur->name != NULL) && - (cur->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); -+ parent = cur; - cur = cur->children; - continue; - } -@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - (info != NULL) && (!info->isinline)) { - if ((cur->next->type != HTML_TEXT_NODE) && - (cur->next->type != HTML_ENTITY_REF_NODE) && -- (cur->parent != NULL) && -- (cur->parent->name != NULL) && -- (cur->parent->name[0] != 'p')) /* p, pre, param */ -+ (parent != NULL) && -+ (parent->name != NULL) && -+ (parent->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); - } - -@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - break; - if (((cur->name == (const xmlChar *)xmlStringText) || - (cur->name != (const xmlChar *)xmlStringTextNoenc)) && -- ((cur->parent == NULL) || -- ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && -- (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { -+ ((parent == NULL) || -+ ((xmlStrcasecmp(parent->name, BAD_CAST "script")) && -+ (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) { - xmlChar *buffer; - - buffer = xmlEncodeEntitiesReentrant(doc, cur->content); -@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - break; - } - -- /* -- * The parent should never be NULL here but we want to handle -- * corrupted documents gracefully. -- */ -- if (cur->parent == NULL) -- return; -- cur = cur->parent; -+ cur = parent; -+ /* cur->parent was validated when descending. */ -+ parent = cur->parent; - - if ((cur->type == XML_HTML_DOCUMENT_NODE) || - (cur->type == XML_DOCUMENT_NODE)) { -@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - (cur->next != NULL)) { - if ((cur->next->type != HTML_TEXT_NODE) && - (cur->next->type != HTML_ENTITY_REF_NODE) && -- (cur->parent != NULL) && -- (cur->parent->name != NULL) && -- (cur->parent->name[0] != 'p')) /* p, pre, param */ -+ (parent != NULL) && -+ (parent->name != NULL) && -+ (parent->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); - } - } -diff --git a/xmlsave.c b/xmlsave.c ---- a/xmlsave.c -+++ b/xmlsave.c -@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - static void - xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - int format = ctxt->format; -- xmlNodePtr tmp, root, unformattedNode = NULL; -+ xmlNodePtr tmp, root, unformattedNode = NULL, parent; - xmlAttrPtr attr; - xmlChar *start, *end; - xmlOutputBufferPtr buf; -@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - buf = ctxt->buf; - - root = cur; -+ parent = cur->parent; - while (1) { - switch (cur->type) { - case XML_DOCUMENT_NODE: -@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - break; - - case XML_DOCUMENT_FRAG_NODE: -- if (cur->children != NULL) { -+ /* Always validate cur->parent when descending. */ -+ if ((cur->parent == parent) && (cur->children != NULL)) { -+ parent = cur; - cur = cur->children; - continue; - } -@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - break; - - case XML_ELEMENT_NODE: -- if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput)) -+ /* -+ * Some users like lxml are known to pass nodes with a corrupted -+ * tree structure. Fall back to a recursive call to handle this -+ * case. -+ */ -+ if ((cur->parent != parent) && (cur->children != NULL)) { -+ xmlNodeDumpOutputInternal(ctxt, cur); -+ break; -+ } -+ -+ if ((ctxt->level > 0) && (ctxt->format == 1) && -+ (xmlIndentTreeOutput)) - xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? - ctxt->indent_nr : ctxt->level), -@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - xmlOutputBufferWrite(buf, 1, ">"); - if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n"); - if (ctxt->level >= 0) ctxt->level++; -+ parent = cur; - cur = cur->children; - continue; - } -@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - break; - } - -- /* -- * The parent should never be NULL here but we want to handle -- * corrupted documents gracefully. -- */ -- if (cur->parent == NULL) -- return; -- cur = cur->parent; -+ cur = parent; -+ /* cur->parent was validated when descending. */ -+ parent = cur->parent; - - if (cur->type == XML_ELEMENT_NODE) { - if (ctxt->level > 0) ctxt->level--; -diff --git a/xmlsave.c b/xmlsave.c ---- a/xmlsave.c -+++ b/xmlsave.c -@@ -890,6 +890,13 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - break; - - case XML_ELEMENT_NODE: -+ if ((cur != root) && (ctxt->format == 1) && -+ (xmlIndentTreeOutput)) -+ xmlOutputBufferWrite(buf, ctxt->indent_size * -+ (ctxt->level > ctxt->indent_nr ? -+ ctxt->indent_nr : ctxt->level), -+ ctxt->indent); -+ - /* - * Some users like lxml are known to pass nodes with a corrupted - * tree structure. Fall back to a recursive call to handle this -@@ -900,13 +907,6 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - break; - } - -- if ((ctxt->level > 0) && (ctxt->format == 1) && -- (xmlIndentTreeOutput)) -- xmlOutputBufferWrite(buf, ctxt->indent_size * -- (ctxt->level > ctxt->indent_nr ? -- ctxt->indent_nr : ctxt->level), -- ctxt->indent); -- - xmlOutputBufferWrite(buf, 1, "<"); - if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { - xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); diff --git a/gnu/packages/patches/libxml2-terminating-newline.patch b/gnu/packages/patches/libxml2-terminating-newline.patch deleted file mode 100644 index 3f5c88dd4e..0000000000 --- a/gnu/packages/patches/libxml2-terminating-newline.patch +++ /dev/null @@ -1,33 +0,0 @@ -Fix a regression in 2.9.12 where serializing empty HTML documents would -not add a terminating newline. - - https://gitlab.gnome.org/GNOME/libxml2/-/issues/266 - -Taken from upstream: - - https://gitlab.gnome.org/GNOME/libxml2/-/commit/92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f - -diff --git a/HTMLtree.c b/HTMLtree.c ---- a/HTMLtree.c -+++ b/HTMLtree.c -@@ -763,11 +763,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - if (((xmlDocPtr) cur)->intSubset != NULL) { - htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL); - } -- /* Always validate cur->parent when descending. */ -- if ((cur->parent == parent) && (cur->children != NULL)) { -- parent = cur; -- cur = cur->children; -- continue; -+ if (cur->children != NULL) { -+ /* Always validate cur->parent when descending. */ -+ if (cur->parent == parent) { -+ parent = cur; -+ cur = cur->children; -+ continue; -+ } -+ } else { -+ xmlOutputBufferWriteString(buf, "\n"); - } - break; - diff --git a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch deleted file mode 100644 index 051196c635..0000000000 --- a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch +++ /dev/null @@ -1,20 +0,0 @@ -Fix recursion accounting in XPath expressions: - - https://gitlab.gnome.org/GNOME/libxml2/-/issues/264 - -Taken from upstream: - - https://gitlab.gnome.org/GNOME/libxml2/-/commit/3e1aad4fe584747fd7d17cc7b2863a78e2d21a77 - -diff --git a/xpath.c b/xpath.c ---- a/xpath.c -+++ b/xpath.c -@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) { - } - - if (xpctxt != NULL) -- xpctxt->depth -= 1; -+ xpctxt->depth -= 10; - } - - /** diff --git a/gnu/packages/patches/linux-pam-unix_chkpwd.patch b/gnu/packages/patches/linux-pam-unix_chkpwd.patch new file mode 100644 index 0000000000..0e865ff18c --- /dev/null +++ b/gnu/packages/patches/linux-pam-unix_chkpwd.patch @@ -0,0 +1,9 @@ +unix_chkpwd is designed to have a suid bit, but it's not possible to set it +for files in the store. This patch tells unix_pam.so to look for +unix_chkpwd in setuid program directory on Guix System. + +--- a/modules/pam_unix/Makefile.in ++++ b/modules/pam_unix/Makefile.in +@@ -651,1 +651,1 @@ +- -DCHKPWD_HELPER=\"$(sbindir)/unix_chkpwd\" \ ++ -DCHKPWD_HELPER=\"/run/setuid-programs/unix_chkpwd\" \ diff --git a/gnu/packages/patches/llvm-8-missing-include.patch b/gnu/packages/patches/llvm-8-missing-include.patch new file mode 100644 index 0000000000..4d7ca6d332 --- /dev/null +++ b/gnu/packages/patches/llvm-8-missing-include.patch @@ -0,0 +1,17 @@ +Add missing include statement for compatibility with libstdc++ 11. + +Taken from upstream: + + https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1 + +diff --git a/utils/benchmark/src/benchmark_register.h b/utils/benchmark/src/benchmark_register.h +--- a/utils/benchmark/src/benchmark_register.h ++++ b/utils/benchmark/src/benchmark_register.h +@@ -1,6 +1,7 @@ + #ifndef BENCHMARK_REGISTER_H + #define BENCHMARK_REGISTER_H + ++#include <limits> + #include <vector> + + #include "check.h" diff --git a/gnu/packages/patches/m4-gnulib-libio.patch b/gnu/packages/patches/m4-gnulib-libio.patch deleted file mode 100644 index a26622ccf3..0000000000 --- a/gnu/packages/patches/m4-gnulib-libio.patch +++ /dev/null @@ -1,128 +0,0 @@ -Adjust the bundled gnulib to cope with removal of libio interface in -glibc 2.28. - -Based on this upstream patch, without hunks that do not apply to m4: -https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e - -diff --git a/lib/fflush.c b/lib/fflush.c -index 983ade0..a6edfa1 100644 ---- a/lib/fflush.c -+++ b/lib/fflush.c -@@ -33,7 +33,7 @@ - #undef fflush - - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ - static void -@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) - - #endif - --#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) -+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) - - # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) - if (stream == NULL || ! freading (stream)) - return fflush (stream); - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - clear_ungetc_buffer_preserving_position (stream); - -diff --git a/lib/fpending.c b/lib/fpending.c -index c84e3a5..789f50e 100644 ---- a/lib/fpending.c -+++ b/lib/fpending.c -@@ -32,7 +32,7 @@ __fpending (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - <stdio.h>, because they need it for implementing getc() and putc() as - fast macros. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return fp->_IO_write_ptr - fp->_IO_write_base; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -diff --git a/lib/fpurge.c b/lib/fpurge.c -index b1d417c..3aedcc3 100644 ---- a/lib/fpurge.c -+++ b/lib/fpurge.c -@@ -62,7 +62,7 @@ fpurge (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - <stdio.h>, because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_IO_read_end = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_write_base; - /* Avoid memory leak when there is an active ungetc buffer. */ -diff --git a/lib/freadahead.c b/lib/freadahead.c -index c2ecb5b..23ec76e 100644 ---- a/lib/freadahead.c -+++ b/lib/freadahead.c -@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *); - size_t - freadahead (FILE *fp) - { --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_write_ptr > fp->_IO_write_base) - return 0; - return (fp->_IO_read_end - fp->_IO_read_ptr) -diff --git a/lib/freading.c b/lib/freading.c -index 73c28ac..c24d0c8 100644 ---- a/lib/freading.c -+++ b/lib/freading.c -@@ -31,7 +31,7 @@ freading (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - <stdio.h>, because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return ((fp->_flags & _IO_NO_WRITES) != 0 - || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 - && fp->_IO_read_base != NULL)); -diff --git a/lib/fseeko.c b/lib/fseeko.c -index 0101ab5..193f4e8 100644 ---- a/lib/fseeko.c -+++ b/lib/fseeko.c -@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) -@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h -index 78d896e..05c5752 100644 ---- a/lib/stdio-impl.h -+++ b/lib/stdio-impl.h -@@ -18,6 +18,12 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - diff --git a/gnu/packages/patches/mesa-skip-tests.patch b/gnu/packages/patches/mesa-skip-tests.patch deleted file mode 100644 index 7ff571dcf5..0000000000 --- a/gnu/packages/patches/mesa-skip-tests.patch +++ /dev/null @@ -1,19 +0,0 @@ -This test fails on i686-linux. I couldn't come up with a regex that -could be used to disable it just on i686-linux, so we disable it -completely with this patch: - -https://gitlab.freedesktop.org/mesa/mesa/-/issues/4091 - -diff --git a/src/util/meson.build b/src/util/meson.build -index 319b22d9bf7..93790c72675 100644 ---- a/src/util/meson.build -+++ b/src/util/meson.build -@@ -344,7 +344,7 @@ if with_tests - ) - endif - -- foreach t: ['bitset', 'register_allocate', 'u_debug_stack', 'u_qsort'] -+ foreach t: ['bitset', 'register_allocate', 'u_qsort'] - test( - t, - executable( diff --git a/gnu/packages/patches/mm-common-reproducible-tarball.patch b/gnu/packages/patches/mm-common-reproducible-tarball.patch new file mode 100644 index 0000000000..f0890aaf57 --- /dev/null +++ b/gnu/packages/patches/mm-common-reproducible-tarball.patch @@ -0,0 +1,40 @@ +From 024c121c844a4ec920133eb3f7e6b6ee8044c0b6 Mon Sep 17 00:00:00 2001 +From: Vagrant Cascadian <[email protected]> +Date: Sat, 12 Dec 2020 04:05:56 +0000 +Original-Patch: https://bugs.debian.org/977177 +Subject: [PATCH] Set uid, username, gid, and group name on files in + generated tarball. + +The user and group may otherwise vary between builds on different systems. + +--- + util/meson_aux/skeletonmm-tarball.py | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/util/meson_aux/skeletonmm-tarball.py b/util/meson_aux/skeletonmm-tarball.py +index db9e650..89049b6 100755 +--- a/util/meson_aux/skeletonmm-tarball.py ++++ b/util/meson_aux/skeletonmm-tarball.py +@@ -39,10 +39,18 @@ elif output_file.endswith('.gz'): + else: + mode = 'w' + ++def reproducible(tarinfo): ++ # Set consistent user and group on files in the tar archive ++ tarinfo.uid = 0 ++ tarinfo.uname = 'root' ++ tarinfo.gid = 0 ++ tarinfo.gname = 'root' ++ return tarinfo ++ + with tarfile.open(output_file, mode=mode) as tar_file: + os.chdir(source_dir) # Input filenames are relative to source_dir. + for file in sys.argv[3:]: +- tar_file.add(file) ++ tar_file.add(file, filter=reproducible) + # Errors raise exceptions. If an exception is raised, Meson+ninja will notice + # that the command failed, despite exit(0). + sys.exit(0) +-- +2.29.2 + diff --git a/gnu/packages/patches/openjdk-10-hotspot-pointer-comparison.patch b/gnu/packages/patches/openjdk-10-hotspot-pointer-comparison.patch new file mode 100644 index 0000000000..2c64d06fbe --- /dev/null +++ b/gnu/packages/patches/openjdk-10-hotspot-pointer-comparison.patch @@ -0,0 +1,15 @@ +Avoid ordered comparison of pointer with integer to prevent compile error +with GCC 11. + +diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp +--- a/src/hotspot/os/linux/os_linux.cpp ++++ b/src/hotspot/os/linux/os_linux.cpp +@@ -2155,7 +2155,7 @@ void os::Linux::print_container_info(outputStream* st) { + } + + p = OSContainer::cpu_cpuset_memory_nodes(); +- if (p < 0) ++ if (p == NULL) + st->print("cpu_memory_nodes() failed\n"); + else { + st->print("cpu_memory_nodes: %s\n", p); diff --git a/gnu/packages/patches/openjdk-10-hotspot-stack-size.patch b/gnu/packages/patches/openjdk-10-hotspot-stack-size.patch new file mode 100644 index 0000000000..2c246dbdbc --- /dev/null +++ b/gnu/packages/patches/openjdk-10-hotspot-stack-size.patch @@ -0,0 +1,28 @@ +Dynamically allocate the stack since SIGSTKSZ is not constant since glibc 2.34. + +Backported from: + + https://github.com/openjdk/jdk17u/commit/bb7c412e259893091210267252faf3c0a1be0969 + +diff --git a/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c b/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c +--- a/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c ++++ b/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c +@@ -67,8 +67,17 @@ static void handler(int sig, siginfo_t *si, void *unused) { + longjmp(context, 1); + } + ++static char* altstack = NULL; ++ + void set_signal_handler() { +- static char altstack[SIGSTKSZ]; ++ if (altstack == NULL) { ++ // Dynamically allocated in case SIGSTKSZ is not constant ++ altstack = malloc(SIGSTKSZ); ++ if (altstack == NULL) { ++ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n"); ++ exit(7); ++ } ++ } + + stack_t ss = { + .ss_size = SIGSTKSZ, diff --git a/gnu/packages/patches/openjdk-9-hotspot-pointer-comparison.patch b/gnu/packages/patches/openjdk-9-hotspot-pointer-comparison.patch new file mode 100644 index 0000000000..b90d736211 --- /dev/null +++ b/gnu/packages/patches/openjdk-9-hotspot-pointer-comparison.patch @@ -0,0 +1,27 @@ +Avoid ordered comparison of pointer with integer to prevent compile error +with GCC 11. + +diff --git a/hotspot/src/share/vm/memory/virtualspace.cpp b/hotspot/src/share/vm/memory/virtualspace.cpp +--- a/hotspot/src/share/vm/memory/virtualspace.cpp ++++ b/hotspot/src/share/vm/memory/virtualspace.cpp +@@ -581,7 +581,7 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, bool large) + assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size], + "area must be distinguishable from marks for mark-sweep"); + +- if (base() > 0) { ++ if (base() != NULL) { + MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); + } + } +diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp +--- a/hotspot/src/share/vm/opto/lcm.cpp ++++ b/hotspot/src/share/vm/opto/lcm.cpp +@@ -39,7 +39,7 @@ + // Check whether val is not-null-decoded compressed oop, + // i.e. will grab into the base of the heap if it represents NULL. + static bool accesses_heap_base_zone(Node *val) { +- if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops. ++ if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops. + if (val && val->is_Mach()) { + if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) { + // This assumes all Decodes with TypePtr::NotNull are matched to nodes that diff --git a/gnu/packages/patches/openjdk-9-hotspot-stack-size.patch b/gnu/packages/patches/openjdk-9-hotspot-stack-size.patch new file mode 100644 index 0000000000..27af0ab6c2 --- /dev/null +++ b/gnu/packages/patches/openjdk-9-hotspot-stack-size.patch @@ -0,0 +1,28 @@ +Dynamically allocate the stack since SIGSTKSZ is not constant since glibc 2.34. + +Backported from: + + https://github.com/openjdk/jdk17u/commit/bb7c412e259893091210267252faf3c0a1be0969 + +diff --git a/hotspot/test/runtime/StackGuardPages/exeinvoke.c b/hotspot/test/runtime/StackGuardPages/exeinvoke.c +--- a/hotspot/test/runtime/StackGuardPages/exeinvoke.c ++++ b/hotspot/test/runtime/StackGuardPages/exeinvoke.c +@@ -67,8 +67,17 @@ static void handler(int sig, siginfo_t *si, void *unused) { + longjmp(context, 1); + } + ++static char* altstack = NULL; ++ + void set_signal_handler() { +- static char altstack[SIGSTKSZ]; ++ if (altstack == NULL) { ++ // Dynamically allocated in case SIGSTKSZ is not constant ++ altstack = malloc(SIGSTKSZ); ++ if (altstack == NULL) { ++ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n"); ++ exit(7); ++ } ++ } + + stack_t ss = { + .ss_size = SIGSTKSZ, diff --git a/gnu/packages/patches/pciutils-hurd-configure.patch b/gnu/packages/patches/pciutils-hurd-configure.patch deleted file mode 100644 index 226891a995..0000000000 --- a/gnu/packages/patches/pciutils-hurd-configure.patch +++ /dev/null @@ -1,35 +0,0 @@ -Add ability to detect GNU/Hurd when configuring. - -Adapted from https://git.hadrons.org/cgit/debian/pkgs/pciutils.git/tree/debian/patches/00-configure-hurd.patch - -From e39a3af22501234a91cf28e8c57b45f9379f9101 Mon Sep 17 00:00:00 2001 -From: Damien Zammit <[email protected]> -Date: Fri, 26 Oct 2018 09:24:04 -0400 -Subject: [PATCH 2/2] Add ability to detect GNU/Hurd when configuring - ---- - lib/configure | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/lib/configure -+++ b/lib/configure -@@ -25,7 +25,7 @@ if [ -z "$HOST" ] ; then - proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1` - cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'` - else -- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` -+ cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` - fi - if [ "$sys" = "DragonFly" ] - then -@@ -39,6 +39,10 @@ if [ -z "$HOST" ] ; then - then - sys=cygwin - fi -+ if [ "$sys" = "GNU" ] -+ then -+ sys=gnu -+ fi - HOST=${3:-$cpu-$sys} - fi - [ -n "$RELEASE" ] && rel="${RELEASE}" diff --git a/gnu/packages/patches/pciutils-hurd-fix.patch b/gnu/packages/patches/pciutils-hurd-fix.patch deleted file mode 100644 index f1979d4352..0000000000 --- a/gnu/packages/patches/pciutils-hurd-fix.patch +++ /dev/null @@ -1,23 +0,0 @@ -Fix a build error on GNU/Hurd for pciutils 3.7.0. - -commit 053cf6c8b2acafadf828912828336d90fe9b8696 -Author: Martin Mares <[email protected]> -Date: Sun May 31 11:53:28 2020 +0200 - - HURD backend should compile again - - Fixes a bug introduced by commit 82c06b47dea5a38075ce9d56f743360bc47b4c78. - -diff --git a/lib/hurd.c b/lib/hurd.c -index 7b3b2ae..ccd92f6 100644 ---- a/lib/hurd.c -+++ b/lib/hurd.c -@@ -307,7 +307,6 @@ hurd_fill_regions(struct pci_dev *d) - d->base_addr[i] |= regions[i].is_64 << 2; - d->base_addr[i] |= regions[i].is_prefetchable << 3; - -- if (flags & PCI_FILL_SIZES) -- d->size[i] = regions[i].size; -+ d->size[i] = regions[i].size; - } - } diff --git a/gnu/packages/patches/python-2.7-expat-compat.patch b/gnu/packages/patches/python-2.7-expat-compat.patch new file mode 100644 index 0000000000..9cbdf8bd6a --- /dev/null +++ b/gnu/packages/patches/python-2.7-expat-compat.patch @@ -0,0 +1,59 @@ +Fix test failure with newer Expat: + + https://bugs.python.org/issue46811 + +This is a backport of this upstream commit: + + https://github.com/python/cpython/commit/2cae93832f46b245847bdc252456ddf7742ef45e + +diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py +index 2eb642395b..1793f9365d 100644 +--- a/Lib/test/test_minidom.py ++++ b/Lib/test/test_minidom.py +@@ -6,12 +6,14 @@ from StringIO import StringIO + from test import support + import unittest + ++import pyexpat + import xml.dom + import xml.dom.minidom + import xml.parsers.expat + + from xml.dom.minidom import parse, Node, Document, parseString + from xml.dom.minidom import getDOMImplementation ++from xml.parsers.expat import ExpatError + + + tstfile = support.findfile("test.xml", subdir="xmltestdata") +@@ -1051,7 +1053,13 @@ class MinidomTest(unittest.TestCase): + + # Verify that character decoding errors raise exceptions instead + # of crashing +- self.assertRaises(UnicodeDecodeError, parseString, ++ if pyexpat.version_info >= (2, 4, 5): ++ self.assertRaises(ExpatError, parseString, ++ b'<fran\xe7ais></fran\xe7ais>') ++ self.assertRaises(ExpatError, parseString, ++ b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>') ++ else: ++ self.assertRaises(UnicodeDecodeError, parseString, + '<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>') + + doc.unlink() +diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py +index c75d55f05c..0855bc07ca 100644 +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -1482,12 +1482,6 @@ class BugsTest(unittest.TestCase): + b"<?xml version='1.0' encoding='ascii'?>\n" + b'<body>tãg</body>') + +- def test_issue3151(self): +- e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>') +- self.assertEqual(e.tag, '{${stuff}}localname') +- t = ET.ElementTree(e) +- self.assertEqual(ET.tostring(e), b'<ns0:localname xmlns:ns0="${stuff}" />') +- + def test_issue6565(self): + elem = ET.XML("<body><tag/></body>") + self.assertEqual(summarize_list(elem), ['tag']) diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch index b44e743c71..d31af35630 100644 --- a/gnu/packages/patches/python-3-fix-tests.patch +++ b/gnu/packages/patches/python-3-fix-tests.patch @@ -6,34 +6,12 @@ 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 <[email protected]>. ---- - 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 -@@ -5,6 +5,7 @@ from test import support +@@ -5,6 +5,7 @@ from ctypes import * from ctypes.test import need_symbol import _ctypes_test @@ -41,7 +19,7 @@ index d8e9c5a760..94fc5929c9 100644 class Callbacks(unittest.TestCase): functype = CFUNCTYPE -@@ -178,6 +179,8 @@ class SampleCallbacksTestCase(unittest.TestCase): +@@ -178,6 +179,8 @@ def func(x): self.assertLess(diff, 0.01, "%s not less than 0.01" % diff) @@ -51,10 +29,10 @@ index d8e9c5a760..94fc5929c9 100644 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 +index 1ff9d019b1..5194954914 100644 --- a/Lib/ctypes/test/test_find.py +++ b/Lib/ctypes/test/test_find.py -@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase): +@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self): with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None): self.assertNotEqual(find_library('c'), None) @@ -66,7 +44,7 @@ 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 +@@ -2,6 +2,7 @@ from ctypes import * import _ctypes_test @@ -74,7 +52,7 @@ index 56285b5ff8..c088ab3db8 100644 lib = CDLL(_ctypes_test.__file__) -@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase): +@@ -17,6 +18,8 @@ def test_sqrt(self): import math self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0)) @@ -84,10 +62,10 @@ index 56285b5ff8..c088ab3db8 100644 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 +index edcec2513e..a716150763 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, +@@ -335,6 +335,7 @@ def test_make_archive_xztar(self): self.assertEqual(os.path.basename(res), 'archive.tar.xz') self.assertEqual(self._tarinfo(res), self._created_files) @@ -95,7 +73,7 @@ index e9aad0e40f..8bbaa51ee5 100644 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, +@@ -364,6 +365,7 @@ def test_make_archive_owner_group(self): @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib") @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") @@ -104,10 +82,10 @@ index e9aad0e40f..8bbaa51ee5 100644 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 +index 752e9db5ba..c66b6323e4 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py -@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase): +@@ -444,6 +444,7 @@ def test_manual_manifest(self): "The tar command is not found") @unittest.skipIf(find_executable('gzip') is None, "The gzip command is not found") @@ -116,10 +94,10 @@ index 23db126959..6e2329df7d 100644 # 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 +index 8dced90c53..59947e3023 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py -@@ -1577,6 +1577,7 @@ class _TestCondition(BaseTestCase): +@@ -1589,6 +1589,7 @@ def _test_wait_result(cls, c, pid): if pid is not None: os.kill(pid, signal.SIGINT) @@ -127,7 +105,7 @@ index e47905c863..31a5a9c308 100644 def test_wait_result(self): if isinstance(self, ProcessesMixin) and sys.platform != 'win32': pid = os.getpid() -@@ -3905,6 +3906,7 @@ class _TestSharedMemory(BaseTestCase): +@@ -4008,6 +4009,7 @@ def test_shared_memory_across_processes(self): sms.close() @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms") @@ -136,10 +114,10 @@ index e47905c863..31a5a9c308 100644 # 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 +index d77bf95a7b..79912c8230 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py -@@ -1341,6 +1341,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase): +@@ -1359,6 +1359,8 @@ def test_create_connection_no_inet_pton(self, m_socket): self._test_create_connection_ip_addr(m_socket, False) @patch_socket @@ -149,10 +127,10 @@ index 533d5cc7f5..c4f860cc3b 100644 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 +index 3bf5f3b743..23368c8d8b 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py -@@ -33,6 +33,7 @@ class SignalAndYieldFromTest(unittest.TestCase): +@@ -33,6 +33,7 @@ def generator2(self): else: return "FAILED" @@ -161,42 +139,40 @@ index 3bf1522808..04bac8a7db 100644 gen = self.generator1() gen.send(None) diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py -index 3da35710b9..5404f9193d 100644 +index bf3fc5fb24..21015403f3 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py -@@ -2408,8 +2408,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()') +@@ -2546,6 +2546,7 @@ def test_rglob(self): + 'pwd module does not expose getpwall()') + @unittest.skipIf(sys.platform == "vxworks", + "no home directory on VxWorks") + @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests") def test_expanduser(self): P = self.cls - support.import_module('pwd') + import_helper.import_module('pwd') diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py -index 8016f81e5a..10190486b4 100644 +index 6ac1a4a3c3..4f58cf9b40 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py -@@ -1219,11 +1219,11 @@ def test_pdb_issue_20766(): +@@ -1315,11 +1315,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()) + > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function() + -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) (Pdb) continue - pdb 2: <built-in function default_int_handler> + pdb 2: Handlers.SIG_IGN """ - + def test_pdb_issue_43318(): diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py -index a77638b10a..2069b349a8 100644 +index 62e6c28280..7ffee56635 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py -@@ -811,6 +811,7 @@ class ArgsTestCase(BaseTestCase): +@@ -810,6 +810,7 @@ def test_fromfile(self): output = self.run_tests('--fromfile', filename) self.check_executed_tests(output, tests) @@ -204,7 +180,7 @@ index a77638b10a..2069b349a8 100644 def test_interrupted(self): code = TEST_INTERRUPTED test = self.create_test('sigint', code=code) -@@ -828,6 +829,7 @@ class ArgsTestCase(BaseTestCase): +@@ -827,6 +828,7 @@ def test_slowest(self): % (self.TESTNAME_REGEX, len(tests))) self.check_line(output, regex) @@ -213,10 +189,10 @@ index a77638b10a..2069b349a8 100644 # 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 +index f2642c6ba1..4358a20dae 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py -@@ -148,6 +148,7 @@ class ResourceTest(unittest.TestCase): +@@ -150,6 +150,7 @@ def test_freebsd_contants(self): @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit') @support.requires_linux_version(2, 6, 36) @@ -225,10 +201,10 @@ index e5ece5284c..5299e54507 100644 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 +index 62e9180375..3eda176fa3 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py -@@ -1427,6 +1427,7 @@ class TestArchives(BaseTest, unittest.TestCase): +@@ -1497,6 +1497,7 @@ def test_make_archive(self): base_name = os.path.join(tmpdir, 'archive') self.assertRaises(ValueError, make_archive, base_name, 'xxx') @@ -236,7 +212,7 @@ index e19af64be0..1b893df6fa 100644 @support.requires_zlib() def test_make_archive_owner_group(self): # testing make_archive with owner and group, with various combinations -@@ -1455,6 +1456,7 @@ class TestArchives(BaseTest, unittest.TestCase): +@@ -1525,6 +1526,7 @@ def test_make_archive_owner_group(self): self.assertTrue(os.path.isfile(res)) @@ -245,10 +221,10 @@ index e19af64be0..1b893df6fa 100644 @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") def test_tarfile_root_owner(self): diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py -index 45553a6a42..55623f01a3 100644 +index c2b5861fc3..3c7a9c42cb 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py -@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase): +@@ -89,6 +89,7 @@ def test_valid_signals(self): self.assertLess(len(s), signal.NSIG) @unittest.skipUnless(sys.executable, "sys.executable required.") @@ -256,7 +232,7 @@ index 45553a6a42..55623f01a3 100644 def test_keyboard_interrupt_exit_code(self): """KeyboardInterrupt triggers exit via SIGINT.""" process = subprocess.run( -@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase): +@@ -139,6 +140,7 @@ def test_issue9324(self): signal.signal(7, handler) @unittest.skipUnless(sys.executable, "sys.executable required.") @@ -264,7 +240,7 @@ index 45553a6a42..55623f01a3 100644 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): +@@ -1322,6 +1324,7 @@ def cycle_handlers(): class RaiseSignalTest(unittest.TestCase): @@ -272,7 +248,7 @@ index 45553a6a42..55623f01a3 100644 def test_sigint(self): with self.assertRaises(KeyboardInterrupt): signal.raise_signal(signal.SIGINT) -@@ -1275,6 +1278,7 @@ class RaiseSignalTest(unittest.TestCase): +@@ -1352,6 +1355,7 @@ def handler(a, b): class PidfdSignalTest(unittest.TestCase): @@ -281,10 +257,10 @@ index 45553a6a42..55623f01a3 100644 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 +index 9c5f6d3dc9..ef74fc5694 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py -@@ -1009,6 +1009,8 @@ class GeneralModuleTests(unittest.TestCase): +@@ -1006,6 +1006,8 @@ def testHostnameRes(self): if not fqhn in all_host_names: self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) @@ -293,16 +269,16 @@ index aefba4f397..6c89f558d5 100755 def test_host_resolution(self): for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']: self.assertEqual(socket.gethostbyname(addr), addr) -@@ -1140,6 +1142,8 @@ class GeneralModuleTests(unittest.TestCase): - self.assertWarns(DeprecationWarning, socket.ntohs, k) - self.assertWarns(DeprecationWarning, socket.htons, k) +@@ -1136,6 +1138,8 @@ def testNtoHErrors(self): + self.assertRaises(OverflowError, socket.ntohl, k) + self.assertRaises(OverflowError, socket.htonl, 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. -@@ -1489,6 +1493,8 @@ class GeneralModuleTests(unittest.TestCase): +@@ -1485,6 +1489,8 @@ def test_sio_loopback_fast_path(self): raise self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None) @@ -311,7 +287,7 @@ index aefba4f397..6c89f558d5 100755 def testGetaddrinfo(self): try: socket.getaddrinfo('localhost', 80) -@@ -1571,6 +1577,8 @@ class GeneralModuleTests(unittest.TestCase): +@@ -1567,6 +1573,8 @@ def test_getnameinfo(self): # only IP addresses are allowed self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0) @@ -321,11 +297,11 @@ index aefba4f397..6c89f558d5 100755 '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 +index a143acc659..f7207887c0 100644 --- 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') +@@ -6,8 +6,7 @@ + spwd = import_helper.import_module('spwd') [email protected](hasattr(os, 'geteuid') and os.geteuid() == 0, @@ -334,7 +310,7 @@ index 07793c84c8..fec672bcbe 100644 class TestSpwdRoot(unittest.TestCase): def test_getspall(self): -@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase): +@@ -57,8 +56,7 @@ def test_getspnam(self): self.assertRaises(TypeError, spwd.getspnam, bytes_name) @@ -345,10 +321,10 @@ index 07793c84c8..fec672bcbe 100644 def test_getspnam_exception(self): diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py -index 29cde91bf7..8d0f20e8bf 100644 +index c658cca7a7..b7188e411e 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py -@@ -2607,9 +2607,12 @@ def root_is_uid_gid_0(): +@@ -2737,9 +2737,12 @@ def root_is_uid_gid_0(): import pwd, grp except ImportError: return False @@ -365,18 +341,18 @@ index 29cde91bf7..8d0f20e8bf 100644 return True diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py -index c21cdf8eb7..6c9d575032 100644 +index c54806e594..d9bbca4e6a 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py -@@ -1398,6 +1398,7 @@ class MiscTestCase(unittest.TestCase): - +@@ -1620,6 +1620,7 @@ def check_interrupt_main_noerror(self, signum): + # Restore original handler + signal.signal(signum, handler) - 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. -@@ -1409,6 +1410,8 @@ class InterruptMainTests(unittest.TestCase): +@@ -1631,6 +1632,8 @@ def call_interrupt(): t.join() t.join() @@ -386,10 +362,10 @@ index c21cdf8eb7..6c9d575032 100644 # 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 +index 213b3cf252..a5edd4a119 100644 --- a/Lib/test/test_unicodedata.py +++ b/Lib/test/test_unicodedata.py -@@ -309,6 +309,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest): +@@ -315,6 +315,7 @@ def test_linebreak_7643(self): self.assertEqual(len(lines), 1, r"\u%.4x should not be a linebreak" % i) @@ -398,10 +374,10 @@ index b552d2bd17..28b1144e15 100644 @staticmethod def check_version(testfile): diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py -index bcfa5e943b..1f2484971b 100644 +index 48feb3f778..e82cafc88a 100644 --- a/Tools/scripts/run_tests.py +++ b/Tools/scripts/run_tests.py -@@ -41,7 +41,7 @@ def main(regrtest_args): +@@ -40,7 +40,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): @@ -410,6 +386,3 @@ index bcfa5e943b..1f2484971b 100644 args.extend(regrtest_args) print(' '.join(args)) if sys.platform == 'win32': --- -2.29.2 - diff --git a/gnu/packages/patches/python-3-no-static-lib.patch b/gnu/packages/patches/python-3-no-static-lib.patch deleted file mode 100644 index b44dbc976c..0000000000 --- a/gnu/packages/patches/python-3-no-static-lib.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: David Malcolm <[email protected]> -Date: Mon, 18 Jan 2010 17:59:07 +0000 -Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Downstream only: not appropriate for upstream. - -See https://bugzilla.redhat.com/show_bug.cgi?id=556092 - -Co-authored-by: David Malcolm <[email protected]> -Co-authored-by: Bohuslav Kabrda <[email protected]> -Co-authored-by: Matej Stuchlik <[email protected]> -Co-authored-by: Robert Kuska <[email protected]> -Co-authored-by: Charalampos Stratakis <[email protected]> -Co-authored-by: Miro Hrončok <[email protected]> ---- - Makefile.pre.in | 21 ++------------------- - 1 file changed, 2 insertions(+), 19 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 0c3981c132..5587422ec7 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -589,7 +589,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) - - # Build the interpreter --$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) -+$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) - $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) - - platform: $(BUILDPYTHON) pybuilddir.txt -@@ -637,12 +637,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - -- --# Build static library --$(LIBRARY): $(LIBRARY_OBJS) -- -rm -f $@ -- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) -- - libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS) - if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ -@@ -724,7 +718,7 @@ Makefile Modules/config.c: Makefile.pre \ - @echo "The Makefile was updated, you may need to re-run make." - - --Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) -+Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) - $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) - - ############################################################################ -@@ -1652,17 +1646,6 @@ libainstall: @DEF_MAKE_RULE@ python-config - else true; \ - fi; \ - done -- @if test -d $(LIBRARY); then :; else \ -- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ -- if test "$(SHLIB_SUFFIX)" = .dll; then \ -- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ -- else \ -- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ -- fi; \ -- else \ -- echo Skip install of $(LIBRARY) - use make frameworkinstall; \ -- fi; \ -- fi - $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c - $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o - $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in diff --git a/gnu/packages/patches/source-highlight-gcc-compat.patch b/gnu/packages/patches/source-highlight-gcc-compat.patch new file mode 100644 index 0000000000..7b543dcf32 --- /dev/null +++ b/gnu/packages/patches/source-highlight-gcc-compat.patch @@ -0,0 +1,74 @@ +Fix various compatibility problems with newer GCC. + +This is an amalgamation of these upstream commits: + + https://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=904949c9026cb772dc93fbe0947a252ef47127f4 + https://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9 + +diff --git a/lib/srchilite/fileutil.cc b/lib/srchilite/fileutil.cc +index 59a6d64..963178c 100644 +--- a/lib/srchilite/fileutil.cc ++++ b/lib/srchilite/fileutil.cc +@@ -48,7 +48,7 @@ void set_file_util_verbose(bool b) { + // FIXME avoid using a global variable + std::string start_path; + +-string readFile(const string &fileName) throw (IOException) { ++string readFile(const string &fileName) { + ifstream file(fileName.c_str()); + + if (!file.is_open()) { +diff --git a/lib/srchilite/fileutil.h b/lib/srchilite/fileutil.h +index 7335a9b..042eb56 100644 +--- a/lib/srchilite/fileutil.h ++++ b/lib/srchilite/fileutil.h +@@ -27,7 +27,7 @@ extern std::string start_path; + * @return the contents of the file + * @throw IOException + */ +-string readFile(const string &fileName) throw (IOException); ++string readFile(const string &fileName); + + //char *read_file(const string &fileName); + +diff --git a/lib/tests/stdboosterror.h b/lib/tests/stdboosterror.h +index 568545b..d59bfa6 100644 +--- a/lib/tests/stdboosterror.h ++++ b/lib/tests/stdboosterror.h +@@ -4,7 +4,7 @@ + #include <boost/regex/pattern_except.hpp> + + static boost::regex_error +- std_boost_exception(boost::regex_error(boost::regex_constants::error_bad_pattern)); ++ std_boost_exception = boost::regex_error(boost::regex_constants::error_bad_pattern); + + /** + * returns the string representing a standard exception (which +diff --git a/lib/tests/test_wordtokenizer_main.cpp b/lib/tests/test_wordtokenizer_main.cpp +index 40e23b1..11ba389 100644 +--- a/lib/tests/test_wordtokenizer_main.cpp ++++ b/lib/tests/test_wordtokenizer_main.cpp +@@ -11,6 +11,14 @@ + using namespace std; + using namespace srchilite; + ++/* ++ * We have to use 'std' namespaces because 'WordTokenizer::WordTokenizerResults::value_type' ++ * is an std::pair<std::string, std::string> in disguise. We have to place 'operator<<()' ++ * into the same namespace for ADL to work. Otherwise gcc-12 or clang-13 can't find the ++ * overload. ++ */ ++namespace std { ++ + static ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &); + + ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &token) { +@@ -23,6 +31,8 @@ ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::val + return os; + } + ++} ++ + int main() { + WordTokenizer::WordTokenizerResults tokens; +
\ No newline at end of file diff --git a/gnu/packages/patches/swig-support-gcc-12.patch b/gnu/packages/patches/swig-support-gcc-12.patch new file mode 100644 index 0000000000..ece7928aa2 --- /dev/null +++ b/gnu/packages/patches/swig-support-gcc-12.patch @@ -0,0 +1,16 @@ +Fix for https://github.com/swig/swig/issues/2145 made in unreleased upstream commit +https://github.com/swig/swig/commit/76d5a9ec270a763c892ae28070e391cf99e0b7cd + +diff --git a/Examples/test-suite/nested_class.i b/Examples/test-suite/nested_class.i +index b10c339493e..c778a12cf7c 100644 +--- a/Examples/test-suite/nested_class.i ++++ b/Examples/test-suite/nested_class.i +@@ -201,7 +201,7 @@ struct Outer { + Integer xx; + } MultipleInstanceAnonDerived1, MultipleInstanceAnonDerived2, *MultipleInstanceAnonDerived3, MultipleInstanceAnonDerived4[2]; + +-#if defined(__GNUC__) || defined(_MSC_VER) || defined(SWIG) ++#if (defined(__GNUC__) && __GNUC__ < 12) || defined(_MSC_VER) || defined(SWIG) + /* some compilers do not accept these */ + struct : public InnerMultiple { + Integer xx; diff --git a/gnu/packages/patches/texinfo-headings-single.patch b/gnu/packages/patches/texinfo-headings-single.patch new file mode 100644 index 0000000000..5147449ddc --- /dev/null +++ b/gnu/packages/patches/texinfo-headings-single.patch @@ -0,0 +1,21 @@ +Fix a regression in 6.8 where the 'single' headings option was not recognized. + +Taken from upstream: + + https://git.savannah.gnu.org/cgit/texinfo.git/commit/?id=13a8894fe2faa45b04033d7122a8fe7939ce6aa2 + +diff --git a/tp/Texinfo/XS/parsetexi/end_line.c b/tp/Texinfo/XS/parsetexi/end_line.c +index 4556780052..3fc2065616 100644 +--- a/tp/Texinfo/XS/parsetexi/end_line.c ++++ b/tp/Texinfo/XS/parsetexi/end_line.c +@@ -778,8 +778,8 @@ kdbinputstyle_invalid: + case CM_headings: + { + if (!strcmp (line, "off") || !strcmp (line, "on") +- || !strcmp (line, "double") || !strcmp (line, "singleafter") +- || !strcmp (line, "doubleafter")) ++ || !strcmp (line, "single") || !strcmp (line, "double") ++ || !strcmp (line, "singleafter") || !strcmp (line, "doubleafter")) + { + ADD_ARG(line); + } diff --git a/gnu/packages/patches/util-linux-CVE-2021-3995.patch b/gnu/packages/patches/util-linux-CVE-2021-3995.patch deleted file mode 100644 index 7faea83801..0000000000 --- a/gnu/packages/patches/util-linux-CVE-2021-3995.patch +++ /dev/null @@ -1,146 +0,0 @@ -Fix CVE-2021-3995: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3995 -https://seclists.org/oss-sec/2022/q1/66 - -Patch copied from upstream source repository: - -https://github.com/util-linux/util-linux/commit/f3db9bd609494099f0c1b95231c5dfe383346929 - -From f3db9bd609494099f0c1b95231c5dfe383346929 Mon Sep 17 00:00:00 2001 -From: Karel Zak <[email protected]> -Date: Wed, 24 Nov 2021 13:53:25 +0100 -Subject: [PATCH] libmount: fix UID check for FUSE umount [CVE-2021-3995] - -Improper UID check allows an unprivileged user to unmount FUSE -filesystems of users with similar UID. - -Signed-off-by: Karel Zak <[email protected]> ---- - include/strutils.h | 2 +- - libmount/src/context_umount.c | 14 +++--------- - libmount/src/mountP.h | 1 + - libmount/src/optstr.c | 42 +++++++++++++++++++++++++++++++++++ - 4 files changed, 47 insertions(+), 12 deletions(-) - -diff --git a/include/strutils.h b/include/strutils.h -index 6e95707ea..a84d29594 100644 ---- a/include/strutils.h -+++ b/include/strutils.h -@@ -106,8 +106,8 @@ static inline char *mem2strcpy(char *dest, const void *src, size_t n, size_t nma - if (n + 1 > nmax) - n = nmax - 1; - -+ memset(dest, '\0', nmax); - memcpy(dest, src, n); -- dest[nmax-1] = '\0'; - return dest; - } - -diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c -index 173637a15..8773c65ff 100644 ---- a/libmount/src/context_umount.c -+++ b/libmount/src/context_umount.c -@@ -453,10 +453,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv) - struct libmnt_ns *ns_old; - const char *type = mnt_fs_get_fstype(cxt->fs); - const char *optstr; -- char *user_id = NULL; -- size_t sz; -- uid_t uid; -- char uidstr[sizeof(stringify_value(ULONG_MAX))]; -+ uid_t uid, entry_uid; - - *errsv = 0; - -@@ -473,11 +470,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv) - optstr = mnt_fs_get_fs_options(cxt->fs); - if (!optstr) - return 0; -- -- if (mnt_optstr_get_option(optstr, "user_id", &user_id, &sz) != 0) -- return 0; -- -- if (sz == 0 || user_id == NULL) -+ if (mnt_optstr_get_uid(optstr, "user_id", &entry_uid) != 0) - return 0; - - /* get current user */ -@@ -494,8 +487,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv) - return 0; - } - -- snprintf(uidstr, sizeof(uidstr), "%lu", (unsigned long) uid); -- return strncmp(user_id, uidstr, sz) == 0; -+ return uid == entry_uid; - } - - /* -diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h -index d43a83541..22442ec55 100644 ---- a/libmount/src/mountP.h -+++ b/libmount/src/mountP.h -@@ -399,6 +399,7 @@ extern const struct libmnt_optmap *mnt_optmap_get_entry( - const struct libmnt_optmap **mapent); - - /* optstr.c */ -+extern int mnt_optstr_get_uid(const char *optstr, const char *name, uid_t *uid); - extern int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end); - extern int mnt_optstr_fix_gid(char **optstr, char *value, size_t valsz, char **next); - extern int mnt_optstr_fix_uid(char **optstr, char *value, size_t valsz, char **next); -diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c -index 921b9318e..16800f571 100644 ---- a/libmount/src/optstr.c -+++ b/libmount/src/optstr.c -@@ -1076,6 +1076,48 @@ int mnt_optstr_fix_user(char **optstr) - return rc; - } - -+/* -+ * Converts value from @optstr addressed by @name to uid. -+ * -+ * Returns: 0 on success, 1 if not found, <0 on error -+ */ -+int mnt_optstr_get_uid(const char *optstr, const char *name, uid_t *uid) -+{ -+ char *value = NULL; -+ size_t valsz = 0; -+ char buf[sizeof(stringify_value(UINT64_MAX))]; -+ int rc; -+ uint64_t num; -+ -+ assert(optstr); -+ assert(name); -+ assert(uid); -+ -+ rc = mnt_optstr_get_option(optstr, name, &value, &valsz); -+ if (rc != 0) -+ goto fail; -+ -+ if (valsz > sizeof(buf) - 1) { -+ rc = -ERANGE; -+ goto fail; -+ } -+ mem2strcpy(buf, value, valsz, sizeof(buf)); -+ -+ rc = ul_strtou64(buf, &num, 10); -+ if (rc != 0) -+ goto fail; -+ if (num > ULONG_MAX || (uid_t) num != num) { -+ rc = -ERANGE; -+ goto fail; -+ } -+ *uid = (uid_t) num; -+ -+ return 0; -+fail: -+ DBG(UTILS, ul_debug("failed to convert '%s'= to number [rc=%d]", name, rc)); -+ return rc; -+} -+ - /** - * mnt_match_options: - * @optstr: options string --- -2.34.0 - diff --git a/gnu/packages/patches/util-linux-CVE-2021-3996.patch b/gnu/packages/patches/util-linux-CVE-2021-3996.patch deleted file mode 100644 index 59edf5c7cf..0000000000 --- a/gnu/packages/patches/util-linux-CVE-2021-3996.patch +++ /dev/null @@ -1,233 +0,0 @@ -Fix CVE-2021-3996: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3996 -https://seclists.org/oss-sec/2022/q1/66 - -Patch copied from upstream source repository: - -https://github.com/util-linux/util-linux/commit/018a10907fa9885093f6d87401556932c2d8bd2b - -From 018a10907fa9885093f6d87401556932c2d8bd2b Mon Sep 17 00:00:00 2001 -From: Karel Zak <[email protected]> -Date: Tue, 4 Jan 2022 10:54:20 +0100 -Subject: [PATCH] libmount: fix (deleted) suffix issue [CVE-2021-3996] - -This issue is related to parsing the /proc/self/mountinfo file allows an -unprivileged user to unmount other user's filesystems that are either -world-writable themselves or mounted in a world-writable directory. - -The support for "(deleted)" is no more necessary as the Linux kernel does -not use it in /proc/self/mountinfo and /proc/self/mount files anymore. - -Signed-off-by: Karel Zak <[email protected]> ---- - libmount/src/tab_parse.c | 5 ----- - tests/expected/findmnt/filter-options | 1 - - tests/expected/findmnt/filter-options-nameval-neg | 3 +-- - tests/expected/findmnt/filter-types-neg | 1 - - tests/expected/findmnt/outputs-default | 3 +-- - tests/expected/findmnt/outputs-force-tree | 3 +-- - tests/expected/findmnt/outputs-kernel | 3 +-- - tests/expected/libmount/tabdiff-mount | 1 - - tests/expected/libmount/tabdiff-move | 1 - - tests/expected/libmount/tabdiff-remount | 1 - - tests/expected/libmount/tabdiff-umount | 1 - - tests/expected/libmount/tabfiles-parse-mountinfo | 11 ----------- - tests/expected/libmount/tabfiles-py-parse-mountinfo | 11 ----------- - tests/ts/findmnt/files/mountinfo | 1 - - tests/ts/findmnt/files/mountinfo-nonroot | 1 - - tests/ts/libmount/files/mountinfo | 1 - - 16 files changed, 4 insertions(+), 44 deletions(-) - -diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c -index 917779ab6..4407f9c9c 100644 ---- a/libmount/src/tab_parse.c -+++ b/libmount/src/tab_parse.c -@@ -227,11 +227,6 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s) - goto fail; - } - -- /* remove "\040(deleted)" suffix */ -- p = (char *) endswith(fs->target, PATH_DELETED_SUFFIX); -- if (p && *p) -- *p = '\0'; -- - s = skip_separator(s); - - /* (6) vfs options (fs-independent) */ -diff --git a/tests/expected/findmnt/filter-options b/tests/expected/findmnt/filter-options -index 2606bce76..97b0ead0a 100644 ---- a/tests/expected/findmnt/filter-options -+++ b/tests/expected/findmnt/filter-options -@@ -28,5 +28,4 @@ TARGET SOURCE FSTYPE OPTIONS - /home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - /var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime - /mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --/mnt/foo /fooooo bar rw,relatime - rc=0 -diff --git a/tests/expected/findmnt/filter-options-nameval-neg b/tests/expected/findmnt/filter-options-nameval-neg -index 5471d65af..f0467ef75 100644 ---- a/tests/expected/findmnt/filter-options-nameval-neg -+++ b/tests/expected/findmnt/filter-options-nameval-neg -@@ -29,6 +29,5 @@ TARGET SOURCE FSTYPE OPTIO - |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered - | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime --|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --`-/mnt/foo /fooooo bar rw,relatime -+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 - rc=0 -diff --git a/tests/expected/findmnt/filter-types-neg b/tests/expected/findmnt/filter-types-neg -index 2606bce76..97b0ead0a 100644 ---- a/tests/expected/findmnt/filter-types-neg -+++ b/tests/expected/findmnt/filter-types-neg -@@ -28,5 +28,4 @@ TARGET SOURCE FSTYPE OPTIONS - /home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - /var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime - /mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --/mnt/foo /fooooo bar rw,relatime - rc=0 -diff --git a/tests/expected/findmnt/outputs-default b/tests/expected/findmnt/outputs-default -index 59495797b..01599355e 100644 ---- a/tests/expected/findmnt/outputs-default -+++ b/tests/expected/findmnt/outputs-default -@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO - |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered - | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime --|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --`-/mnt/foo /fooooo bar rw,relatime -+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 - rc=0 -diff --git a/tests/expected/findmnt/outputs-force-tree b/tests/expected/findmnt/outputs-force-tree -index 59495797b..01599355e 100644 ---- a/tests/expected/findmnt/outputs-force-tree -+++ b/tests/expected/findmnt/outputs-force-tree -@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO - |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered - | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime --|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --`-/mnt/foo /fooooo bar rw,relatime -+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 - rc=0 -diff --git a/tests/expected/findmnt/outputs-kernel b/tests/expected/findmnt/outputs-kernel -index 59495797b..01599355e 100644 ---- a/tests/expected/findmnt/outputs-kernel -+++ b/tests/expected/findmnt/outputs-kernel -@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO - |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered - | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 - |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime --|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --`-/mnt/foo /fooooo bar rw,relatime -+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 - rc=0 -diff --git a/tests/expected/libmount/tabdiff-mount b/tests/expected/libmount/tabdiff-mount -index 420aeacd5..3c18f8dc4 100644 ---- a/tests/expected/libmount/tabdiff-mount -+++ b/tests/expected/libmount/tabdiff-mount -@@ -1,3 +1,2 @@ - /dev/mapper/kzak-home on /home/kzak: MOUNTED --/fooooo on /mnt/foo: MOUNTED - tmpfs on /mnt/test/foo
bar: MOUNTED -diff --git a/tests/expected/libmount/tabdiff-move b/tests/expected/libmount/tabdiff-move -index 24f9bc791..95820d93e 100644 ---- a/tests/expected/libmount/tabdiff-move -+++ b/tests/expected/libmount/tabdiff-move -@@ -1,3 +1,2 @@ - //foo.home/bar/ on /mnt/music: MOVED to /mnt/music --/fooooo on /mnt/foo: UMOUNTED - tmpfs on /mnt/test/foo
bar: UMOUNTED -diff --git a/tests/expected/libmount/tabdiff-remount b/tests/expected/libmount/tabdiff-remount -index 82ebeab39..876bfd953 100644 ---- a/tests/expected/libmount/tabdiff-remount -+++ b/tests/expected/libmount/tabdiff-remount -@@ -1,4 +1,3 @@ - /dev/mapper/kzak-home on /home/kzak: REMOUNTED from 'rw,noatime,barrier=1,data=ordered' to 'ro,noatime,barrier=1,data=ordered' - //foo.home/bar/ on /mnt/sounds: REMOUNTED from 'rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344' to 'ro,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344' --/fooooo on /mnt/foo: UMOUNTED - tmpfs on /mnt/test/foo
bar: UMOUNTED -diff --git a/tests/expected/libmount/tabdiff-umount b/tests/expected/libmount/tabdiff-umount -index a3e0fe48a..c7be725b9 100644 ---- a/tests/expected/libmount/tabdiff-umount -+++ b/tests/expected/libmount/tabdiff-umount -@@ -1,3 +1,2 @@ - /dev/mapper/kzak-home on /home/kzak: UMOUNTED --/fooooo on /mnt/foo: UMOUNTED - tmpfs on /mnt/test/foo
bar: UMOUNTED -diff --git a/tests/expected/libmount/tabfiles-parse-mountinfo b/tests/expected/libmount/tabfiles-parse-mountinfo -index 47eb77006..d5ba5248e 100644 ---- a/tests/expected/libmount/tabfiles-parse-mountinfo -+++ b/tests/expected/libmount/tabfiles-parse-mountinfo -@@ -351,17 +351,6 @@ id: 47 - parent: 20 - devno: 0:38 - ------ fs: --source: /fooooo --target: /mnt/foo --fstype: bar --optstr: rw,relatime --VFS-optstr: rw,relatime --FS-opstr: rw --root: / --id: 48 --parent: 20 --devno: 0:39 -------- fs: - source: tmpfs - target: /mnt/test/foo
bar - fstype: tmpfs -diff --git a/tests/expected/libmount/tabfiles-py-parse-mountinfo b/tests/expected/libmount/tabfiles-py-parse-mountinfo -index 47eb77006..d5ba5248e 100644 ---- a/tests/expected/libmount/tabfiles-py-parse-mountinfo -+++ b/tests/expected/libmount/tabfiles-py-parse-mountinfo -@@ -351,17 +351,6 @@ id: 47 - parent: 20 - devno: 0:38 - ------ fs: --source: /fooooo --target: /mnt/foo --fstype: bar --optstr: rw,relatime --VFS-optstr: rw,relatime --FS-opstr: rw --root: / --id: 48 --parent: 20 --devno: 0:39 -------- fs: - source: tmpfs - target: /mnt/test/foo
bar - fstype: tmpfs -diff --git a/tests/ts/findmnt/files/mountinfo b/tests/ts/findmnt/files/mountinfo -index 475ea1a33..ff1e664a8 100644 ---- a/tests/ts/findmnt/files/mountinfo -+++ b/tests/ts/findmnt/files/mountinfo -@@ -30,4 +30,3 @@ - 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500 - 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw - 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw -diff --git a/tests/ts/findmnt/files/mountinfo-nonroot b/tests/ts/findmnt/files/mountinfo-nonroot -index e15b46701..87b421d2e 100644 ---- a/tests/ts/findmnt/files/mountinfo-nonroot -+++ b/tests/ts/findmnt/files/mountinfo-nonroot -@@ -29,4 +29,3 @@ - 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500 - 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw - 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw -diff --git a/tests/ts/libmount/files/mountinfo b/tests/ts/libmount/files/mountinfo -index c06307183..2b0174048 100644 ---- a/tests/ts/libmount/files/mountinfo -+++ b/tests/ts/libmount/files/mountinfo -@@ -30,5 +30,4 @@ - 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500 - 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw - 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 --48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw - 49 20 0:56 / /mnt/test/foo
bar rw,relatime shared:323 - tmpfs tmpfs rw --- -2.34.0 - |