mirror of
https://abf.rosa.ru/djam/glibc40.git
synced 2025-02-23 15:52:52 +00:00
27 lines
962 B
Diff
27 lines
962 B
Diff
![]() |
--- glibc-2.14-121-g5551a7b/nss/nsswitch.c.nss-upgrade 2011-07-20 02:41:44.000000000 +0200
|
||
|
+++ glibc-2.14-121-g5551a7b/nss/nsswitch.c 2011-07-24 01:06:25.658666115 +0200
|
||
|
@@ -330,9 +330,20 @@ nss_load_library (service_user *ni)
|
||
|
ni->library->lib_handle = __libc_dlopen (shlib_name);
|
||
|
if (ni->library->lib_handle == NULL)
|
||
|
{
|
||
|
- /* Failed to load the library. */
|
||
|
- ni->library->lib_handle = (void *) -1l;
|
||
|
- __set_errno (saved_errno);
|
||
|
+ /* Failed to load the library. Try a fallback. */
|
||
|
+ int n = __snprintf(shlib_name, shlen, "libnss_%s.so.%d.%d",
|
||
|
+ ni->library->name, __GLIBC__, __GLIBC_MINOR__);
|
||
|
+ if (n >= shlen)
|
||
|
+ ni->library->lib_handle = NULL;
|
||
|
+ else
|
||
|
+ ni->library->lib_handle = __libc_dlopen (shlib_name);
|
||
|
+
|
||
|
+ if (ni->library->lib_handle == NULL)
|
||
|
+ {
|
||
|
+ /* Ok, really fail now. */
|
||
|
+ ni->library->lib_handle = (void *) -1l;
|
||
|
+ __set_errno (saved_errno);
|
||
|
+ }
|
||
|
}
|
||
|
else if (is_nscd)
|
||
|
{
|