1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

nsswitch: use new internal API (core)

Core changes to switch the NSS internals to use the new API.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
DJ Delorie
2020-11-09 22:06:57 -05:00
parent fa78feca47
commit f8847d83e1
8 changed files with 169 additions and 846 deletions

View File

@ -16,8 +16,7 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include "nss_action.h"
#include "nss_module.h"
#include <nsswitch.h>
#include <ctype.h>
#include <string.h>
@ -169,18 +168,13 @@ nss_action_list
action_list_init (&list);
if (nss_action_parse (line, &list))
{
size_t size = action_list_size (&list);
nss_action_list result
= malloc (sizeof (*result) * (size + 1));
if (result == NULL)
{
action_list_free (&list);
return NULL;
}
memcpy (result, action_list_begin (&list), sizeof (*result) * size);
/* Sentinel. */
result[size].module = NULL;
return result;
size_t size;
struct nss_action null_service
= { .module = NULL, };
action_list_add (&list, null_service);
size = action_list_size (&list);
return __nss_action_allocate (action_list_begin (&list), size);
}
else if (action_list_has_failed (&list))
{