Hello community, here is the log from the commit of package glibc for openSUSE:Factory checked in at 2020-11-15 15:17:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/glibc (Old) and /work/SRC/openSUSE:Factory/.glibc.new.24930 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "glibc" Sun Nov 15 15:17:07 2020 rev:242 rq:847891 version:2.32 Changes: -------- --- /work/SRC/openSUSE:Factory/glibc/glibc.changes 2020-11-03 15:15:14.531963626 +0100 +++ /work/SRC/openSUSE:Factory/.glibc.new.24930/glibc.changes 2020-11-15 15:17:27.406880775 +0100 @@ -1,0 +2,10 @@ +Tue Nov 10 15:36:40 UTC 2020 - Andreas Schwab <[email protected]> + +- intl-codeset-suffixes.patch: intl: Handle translation output codesets + with suffixes (BZ #26383) +- strerrorname-np.patch: string: Fix strerrorname_np return value (BZ + #26555) +- sysvipc.patch: sysvipc: Fix SEM_STAT_ANY kernel argument pass (BZ + #26637, BZ #26639, BZ #26636) + +------------------------------------------------------------------- New: ---- intl-codeset-suffixes.patch strerrorname-np.patch sysvipc.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ glibc.spec ++++++ --- /var/tmp/diff_new_pack.Gwc6Ay/_old 2020-11-15 15:17:35.134888958 +0100 +++ /var/tmp/diff_new_pack.Gwc6Ay/_new 2020-11-15 15:17:35.138888962 +0100 @@ -263,6 +263,12 @@ Patch1000: syslog-locking.patch # PATCH-FIX-UPSTREAM x86-64: Fix FMA4 detection in ifunc (BZ #26534) Patch1001: ifunc-fma4.patch +# PATCH-FIX-UPSTREAM intl: Handle translation output codesets with suffixes (BZ #26383) +Patch1002: intl-codeset-suffixes.patch +# PATCH-FIX-UPSTREAM string: Fix strerrorname_np return value (BZ #26555) +Patch1003: strerrorname-np.patch +# PATCH-FIX-UPSTREAM sysvipc: Fix SEM_STAT_ANY kernel argument pass (BZ #26637, BZ #26639, BZ #26636) +Patch1004: sysvipc.patch ### # Patches awaiting upstream approval @@ -477,6 +483,9 @@ %patch1000 -p1 %patch1001 -p1 +%patch1002 -p1 +%patch1003 -p1 +%patch1004 -p1 %patch2000 -p1 %patch2001 -p1 ++++++ intl-codeset-suffixes.patch ++++++ From fe62c4d173f3cc1ac64f01e75a8f421b2f092cdb Mon Sep 17 00:00:00 2001 From: Arjun Shankar <[email protected]> Date: Fri, 25 Sep 2020 14:47:06 +0200 Subject: [PATCH] intl: Handle translation output codesets with suffixes [BZ #26383] Commit 91927b7c7643 (Rewrite iconv option parsing [BZ #19519]) did not handle cases where the output codeset for translations (via the `gettext' family of functions) might have a caller specified encoding suffix such as TRANSLIT or IGNORE. This led to a regression where translations did not work when the codeset had a suffix. This commit fixes the above issue by parsing any suffixes passed to __dcigettext and adds two new test-cases to intl/tst-codeset.c to verify correct behaviour. The iconv-internal function __gconv_create_spec and the static iconv-internal function gconv_destroy_spec are now visible internally within glibc and used in intl/dcigettext.c. (cherry picked from commit 7d4ec75e111291851620c6aa2c4460647b7fd50d) --- Index: glibc-2.32/iconv/Versions =================================================================== --- glibc-2.32.orig/iconv/Versions +++ glibc-2.32/iconv/Versions @@ -6,7 +6,9 @@ libc { GLIBC_PRIVATE { # functions shared with iconv program __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db; - __gconv_open; __gconv_create_spec; + + # functions used elsewhere in glibc + __gconv_open; __gconv_create_spec; __gconv_destroy_spec; # function used by the gconv modules __gconv_transliterate; Index: glibc-2.32/iconv/gconv_charset.c =================================================================== --- glibc-2.32.orig/iconv/gconv_charset.c +++ glibc-2.32/iconv/gconv_charset.c @@ -216,3 +216,13 @@ out: return ret; } libc_hidden_def (__gconv_create_spec) + + +void +__gconv_destroy_spec (struct gconv_spec *conv_spec) +{ + free (conv_spec->fromcode); + free (conv_spec->tocode); + return; +} +libc_hidden_def (__gconv_destroy_spec) Index: glibc-2.32/iconv/gconv_charset.h =================================================================== --- glibc-2.32.orig/iconv/gconv_charset.h +++ glibc-2.32/iconv/gconv_charset.h @@ -48,33 +48,6 @@ #define GCONV_IGNORE_ERRORS_SUFFIX "IGNORE" -/* This function accepts the charset names of the source and destination of the - conversion and populates *conv_spec with an equivalent conversion - specification that may later be used by __gconv_open. The charset names - might contain options in the form of suffixes that alter the conversion, - e.g. "ISO-10646/UTF-8/TRANSLIT". It processes the charset names, ignoring - and truncating any suffix options in fromcode, and processing and truncating - any suffix options in tocode. Supported suffix options ("TRANSLIT" or - "IGNORE") when found in tocode lead to the corresponding flag in *conv_spec - to be set to true. Unrecognized suffix options are silently discarded. If - the function succeeds, it returns conv_spec back to the caller. It returns - NULL upon failure. */ -struct gconv_spec * -__gconv_create_spec (struct gconv_spec *conv_spec, const char *fromcode, - const char *tocode); -libc_hidden_proto (__gconv_create_spec) - - -/* This function frees all heap memory allocated by __gconv_create_spec. */ -static void __attribute__ ((unused)) -gconv_destroy_spec (struct gconv_spec *conv_spec) -{ - free (conv_spec->fromcode); - free (conv_spec->tocode); - return; -} - - /* This function copies in-order, characters from the source 's' that are either alpha-numeric or one in one of these: "_-.,:/" - into the destination 'wp' while dropping all other characters. In the process, it converts all Index: glibc-2.32/iconv/gconv_int.h =================================================================== --- glibc-2.32.orig/iconv/gconv_int.h +++ glibc-2.32/iconv/gconv_int.h @@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_sp __gconv_t *handle, int flags); libc_hidden_proto (__gconv_open) +/* This function accepts the charset names of the source and destination of the + conversion and populates *conv_spec with an equivalent conversion + specification that may later be used by __gconv_open. The charset names + might contain options in the form of suffixes that alter the conversion, + e.g. "ISO-10646/UTF-8/TRANSLIT". It processes the charset names, ignoring + and truncating any suffix options in fromcode, and processing and truncating + any suffix options in tocode. Supported suffix options ("TRANSLIT" or + "IGNORE") when found in tocode lead to the corresponding flag in *conv_spec + to be set to true. Unrecognized suffix options are silently discarded. If + the function succeeds, it returns conv_spec back to the caller. It returns + NULL upon failure. */ +extern struct gconv_spec * +__gconv_create_spec (struct gconv_spec *conv_spec, const char *fromcode, + const char *tocode); +libc_hidden_proto (__gconv_create_spec) + +/* This function frees all heap memory allocated by __gconv_create_spec. */ +extern void +__gconv_destroy_spec (struct gconv_spec *conv_spec); +libc_hidden_proto (__gconv_destroy_spec) + /* Free resources associated with transformation descriptor CD. */ extern int __gconv_close (__gconv_t cd) attribute_hidden; Index: glibc-2.32/iconv/iconv_open.c =================================================================== --- glibc-2.32.orig/iconv/iconv_open.c +++ glibc-2.32/iconv/iconv_open.c @@ -39,7 +39,7 @@ iconv_open (const char *tocode, const ch int res = __gconv_open (&conv_spec, &cd, 0); - gconv_destroy_spec (&conv_spec); + __gconv_destroy_spec (&conv_spec); if (__builtin_expect (res, __GCONV_OK) != __GCONV_OK) { Index: glibc-2.32/iconv/iconv_prog.c =================================================================== --- glibc-2.32.orig/iconv/iconv_prog.c +++ glibc-2.32/iconv/iconv_prog.c @@ -184,7 +184,7 @@ main (int argc, char *argv[]) /* Let's see whether we have these coded character sets. */ res = __gconv_open (&conv_spec, &cd, 0); - gconv_destroy_spec (&conv_spec); + __gconv_destroy_spec (&conv_spec); if (res != __GCONV_OK) { Index: glibc-2.32/intl/dcigettext.c =================================================================== --- glibc-2.32.orig/intl/dcigettext.c +++ glibc-2.32/intl/dcigettext.c @@ -1121,15 +1121,18 @@ _nl_find_msg (struct loaded_l10nfile *do # ifdef _LIBC - struct gconv_spec conv_spec - = { .fromcode = norm_add_slashes (charset, ""), - .tocode = norm_add_slashes (outcharset, ""), - /* We always want to use transliteration. */ - .translit = true, - .ignore = false - }; + struct gconv_spec conv_spec; + + __gconv_create_spec (&conv_spec, charset, outcharset); + + /* We always want to use transliteration. */ + conv_spec.translit = true; + int r = __gconv_open (&conv_spec, &convd->conv, GCONV_AVOID_NOCONV); + + __gconv_destroy_spec (&conv_spec); + if (__builtin_expect (r != __GCONV_OK, 0)) { /* If the output encoding is the same there is Index: glibc-2.32/intl/tst-codeset.c =================================================================== --- glibc-2.32.orig/intl/tst-codeset.c +++ glibc-2.32/intl/tst-codeset.c @@ -22,13 +22,11 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <support/check.h> static int do_test (void) { - char *s; - int result = 0; - unsetenv ("LANGUAGE"); unsetenv ("OUTPUT_CHARSET"); setlocale (LC_ALL, "de_DE.ISO-8859-1"); @@ -36,25 +34,21 @@ do_test (void) bindtextdomain ("codeset", OBJPFX "domaindir"); /* Here we expect output in ISO-8859-1. */ - s = gettext ("cheese"); - if (strcmp (s, "K\344se")) - { - printf ("call 1 returned: %s\n", s); - result = 1; - } + TEST_COMPARE_STRING (gettext ("cheese"), "K\344se"); + /* Here we expect output in UTF-8. */ bind_textdomain_codeset ("codeset", "UTF-8"); + TEST_COMPARE_STRING (gettext ("cheese"), "K\303\244se"); - /* Here we expect output in UTF-8. */ - s = gettext ("cheese"); - if (strcmp (s, "K\303\244se")) - { - printf ("call 2 returned: %s\n", s); - result = 1; - } + /* `a with umlaut' is transliterated to `ae'. */ + bind_textdomain_codeset ("codeset", "ASCII//TRANSLIT"); + TEST_COMPARE_STRING (gettext ("cheese"), "Kaese"); + + /* Transliteration also works by default even if not set. */ + bind_textdomain_codeset ("codeset", "ASCII"); + TEST_COMPARE_STRING (gettext ("cheese"), "Kaese"); - return result; + return 0; } -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" +#include <support/test-driver.c> ++++++ strerrorname-np.patch ++++++ ++++ 1676 lines (skipped) ++++++ sysvipc.patch ++++++ ++++ 796 lines (skipped) _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
