File glibc-2.3.90-langpackdir.diff of Package glibc

Index: glibc-2.38/debug/strcpy_chk.c
===================================================================
--- glibc-2.38.orig/debug/strcpy_chk.c
+++ glibc-2.38/debug/strcpy_chk.c
@@ -31,3 +31,4 @@ __strcpy_chk (char *dest, const char *sr
 
   return memcpy (dest, src, len + 1);
 }
+libc_hidden_builtin_def (__strcpy_chk)
Index: glibc-2.38/include/string.h
===================================================================
--- glibc-2.38.orig/include/string.h
+++ glibc-2.38/include/string.h
@@ -213,6 +213,7 @@ libc_hidden_builtin_proto (__memcpy_chk)
 libc_hidden_builtin_proto (__memmove_chk)
 libc_hidden_builtin_proto (__mempcpy_chk)
 libc_hidden_builtin_proto (__memset_chk)
+libc_hidden_builtin_proto (__strcpy_chk)
 libc_hidden_builtin_proto (__stpcpy_chk)
 libc_hidden_builtin_proto (__strncpy_chk)
 
Index: glibc-2.38/intl/loadmsgcat.c
===================================================================
--- glibc-2.38.orig/intl/loadmsgcat.c
+++ glibc-2.38/intl/loadmsgcat.c
@@ -796,8 +796,26 @@ _nl_load_domain (struct loaded_l10nfile
   if (domain_file->filename == NULL)
     goto out;
 
-  /* Try to open the addressed file.  */
-  fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+  /* Replace /locale/ with /usr/share/locale-langpack/ */
+  const char *langpackdir = "/usr/share/locale-langpack/";
+  char *filename_langpack = malloc (strlen (domain_file->filename)
+				    + strlen (langpackdir));
+  if (filename_langpack != NULL)
+    {
+      char *p = strstr (domain_file->filename, "/locale/");
+      if (p != NULL)
+	{
+	  strcpy (__stpcpy (filename_langpack, langpackdir), p + 8);
+	  fd = open (filename_langpack, O_RDONLY | O_BINARY);
+	}
+
+      free (filename_langpack);
+    }
+
+  if (fd == -1)
+    /* Try to open the addressed file.  */
+    fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+
   if (fd == -1)
     goto out;
 
openSUSE Build Service is sponsored by