1 diff -Naur glibc-2.27-orig/locale/loadarchive.c glibc-2.27/locale/loadarchive.c
2 --- glibc-2.27-orig/locale/loadarchive.c 2018-02-01 11:17:18.000000000 -0500
3 +++ glibc-2.27/locale/loadarchive.c 2018-02-17 22:32:25.680169462 -0500
5 return MAX (namehash_end, MAX (string_end, locrectab_end));
9 +open_locale_archive (void)
12 + char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
13 + char *path = getenv ("LOCALE_ARCHIVE");
15 + fd = __open_nocancel (versioned_path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
17 + fd = __open_nocancel (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
19 + fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
21 + fd = __open_nocancel ("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC);
26 /* Find the locale *NAMEP in the locale archive, and return the
27 internalized data structure for its CATEGORY data. If this locale has
29 archmapped = &headmap;
31 /* The archive has never been opened. */
32 - fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
33 + fd = open_locale_archive ();
35 /* Cannot open the archive, for whatever reason. */
41 - fd = __open_nocancel (archfname,
42 - O_RDONLY|O_LARGEFILE|O_CLOEXEC);
43 + fd = open_locale_archive ();
45 /* Cannot open the archive, for whatever reason. */
47 diff -Naur glibc-2.27-orig/locale/programs/locale.c glibc-2.27/locale/programs/locale.c
48 --- glibc-2.27-orig/locale/programs/locale.c 2018-02-01 11:17:18.000000000 -0500
49 +++ glibc-2.27/locale/programs/locale.c 2018-02-17 22:36:39.726293213 -0500
54 +open_locale_archive (void)
57 + char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
58 + char *path = getenv ("LOCALE_ARCHIVE");
60 + fd = open64 (versioned_path, O_RDONLY);
62 + fd = open64 (path, O_RDONLY);
64 + fd = open64 (ARCHIVE_NAME, O_RDONLY);
66 + fd = open64 ("/usr/lib/locale/locale-archive", O_RDONLY);
72 write_archive_locales (void **all_datap, char *linebuf)
79 - fd = open64 (ARCHIVE_NAME, O_RDONLY);
80 + fd = open_locale_archive ();
84 diff -Naur glibc-2.27-orig/locale/programs/locarchive.c glibc-2.27/locale/programs/locarchive.c
85 --- glibc-2.27-orig/locale/programs/locarchive.c 2018-02-01 11:17:18.000000000 -0500
86 +++ glibc-2.27/locale/programs/locarchive.c 2018-02-17 22:40:51.245293975 -0500
92 +open_locale_archive (const char * archivefname, int flags)
95 + char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
96 + char *path = getenv ("LOCALE_ARCHIVE");
98 + fd = open64 (versioned_path, flags);
100 + fd = open64 (path, flags);
102 + fd = open64 (archivefname, flags);
108 create_archive (const char *archivefname, struct locarhandle *ah)
113 /* Open the archive. We must have exclusive write access. */
114 - fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
115 + fd = open_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
118 /* Maybe the file does not yet exist? If we are opening