[0/7] More type safety for NSS modules
mbox series

Message ID cover.1581517927.git.fweimer@redhat.com
Headers show
Series
  • More type safety for NSS modules
Related show

Message

Florian Weimer Feb. 12, 2020, 2:34 p.m. UTC
This series adds a macro NSS_DECLARE_MODULE_FUNCTIONS macro to <nss.h>.
Module authors can use this macro to declare all the possible functions
for a module, and define only the function they need.  This avoids type
mismatches in these interfaces.

As a side effect, we now have what is hopefully a complete list of all
such module functions.  This should help with re-architecting the
internal NSS functions for nsswitch.conf reloading.

Thanks,
Florian

Florian Weimer (7):
  nss_compat: Do not use nss_* names for function pointers
  nss: Add function types and NSS_DECLARE_MODULE_FUNCTIONS macro to
    <nss.h>
  nss_hesiod: Use NSS_DECLARE_MODULE_FUNCTIONS
  nss_compat: Use NSS_DECLARE_MODULE_FUNCTIONS
  nss_db: Use NSS_DECLARE_MODULE_FUNCTIONS
  nss_files: Use NSS_DECLARE_MODULE_FUNCTIONS
  nss_dns: Use NSS_DECLARE_MODULE_FUNCTIONS

 hesiod/nss_hesiod/hesiod-grp.c     |   2 +
 hesiod/nss_hesiod/hesiod-proto.c   |   2 +
 hesiod/nss_hesiod/hesiod-pwd.c     |   2 +
 hesiod/nss_hesiod/hesiod-service.c |   2 +
 nscd/aicache.c                     |  23 +---
 nss/nss.h                          | 203 ++++++++++++++++++++++++++++-
 nss/nss_compat/compat-grp.c        |  56 ++++----
 nss/nss_compat/compat-initgroups.c |  73 ++++++-----
 nss/nss_compat/compat-pwd.c        |  58 +++++----
 nss/nss_compat/compat-spwd.c       |  46 +++----
 nss/nss_db/db-init.c               |   2 +
 nss/nss_db/db-initgroups.c         |   1 -
 nss/nss_db/nss_db.h                |   1 +
 nss/nss_files/files-alias.c        |   2 +
 nss/nss_files/files-ethers.c       |   3 +
 nss/nss_files/files-grp.c          |   3 +
 nss/nss_files/files-hosts.c        |   2 +
 nss/nss_files/files-init.c         |   3 +
 nss/nss_files/files-initgroups.c   |   3 +
 nss/nss_files/files-key.c          |   2 +
 nss/nss_files/files-netgrp.c       |   2 +
 nss/nss_files/files-network.c      |   3 +
 nss/nss_files/files-proto.c        |   2 +
 nss/nss_files/files-pwd.c          |   3 +
 nss/nss_files/files-rpc.c          |   2 +
 nss/nss_files/files-service.c      |   2 +
 nss/nss_files/files-sgrp.c         |   3 +
 nss/nss_files/files-spwd.c         |   3 +
 resolv/nss_dns/dns-canon.c         |   2 +
 resolv/nss_dns/dns-host.c          |   2 +
 resolv/nss_dns/dns-network.c       |   2 +
 sysdeps/posix/getaddrinfo.c        |  18 +--
 32 files changed, 384 insertions(+), 149 deletions(-)