about summary refs log tree commit diff
path: root/nss/nss_module.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-07-19 07:55:27 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-07-19 07:56:57 +0200
commitee5ed99922ca90bcea4a2f9a48a0c9ae4b534ece (patch)
treefd5d30e2d8a6f676f63698560094da119108806c /nss/nss_module.h
parente1fcf21474c5b522fdad4ac0191d5dcc3271dba6 (diff)
downloadglibc-ee5ed99922ca90bcea4a2f9a48a0c9ae4b534ece.tar.gz
glibc-ee5ed99922ca90bcea4a2f9a48a0c9ae4b534ece.tar.xz
glibc-ee5ed99922ca90bcea4a2f9a48a0c9ae4b534ece.zip
nss: Directly load nss_dns, without going through dlsym/dlopen
This partially fixes static-only NSS support (bug 27959): The dns
module no longer needs dlopen.  Support for disabling dlopen altogher
remains to be added.

This commit introduces module_load_builtin into nss/nss_module.c, which
handles the common parts of loading the built-in nss_files and nss_dns
modules.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nss/nss_module.h')
-rw-r--r--nss/nss_module.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/nss/nss_module.h b/nss/nss_module.h
index c1a1d90b60..b52c2935d2 100644
--- a/nss/nss_module.h
+++ b/nss/nss_module.h
@@ -33,10 +33,16 @@ struct nss_module_functions
 #include "function.def"
 };
 
+/* Number of elements of the nss_module_functions_untyped array.  */
+enum
+  {
+    nss_module_functions_count = (sizeof (struct nss_module_functions)
+                                  / sizeof (void *))
+  };
+
 /* Untyped version of struct nss_module_functions, for consistent
    processing purposes.  */
-typedef void *nss_module_functions_untyped[sizeof (struct nss_module_functions)
-                                           / sizeof (void *)];
+typedef void *nss_module_functions_untyped[nss_module_functions_count];
 
 /* Locate the nss_files functions, as if by dlopen/dlsym.  */
 void __nss_files_functions (nss_module_functions_untyped pointers)