summaryrefslogtreecommitdiff
path: root/hesiod/nss_hesiod
diff options
context:
space:
mode:
Diffstat (limited to 'hesiod/nss_hesiod')
-rw-r--r--hesiod/nss_hesiod/hesiod-grp.c10
-rw-r--r--hesiod/nss_hesiod/hesiod-init.c38
-rw-r--r--hesiod/nss_hesiod/hesiod-proto.c7
-rw-r--r--hesiod/nss_hesiod/hesiod-pwd.c7
-rw-r--r--hesiod/nss_hesiod/hesiod-service.c7
-rw-r--r--hesiod/nss_hesiod/nss_hesiod.h20
6 files changed, 9 insertions, 80 deletions
diff --git a/hesiod/nss_hesiod/hesiod-grp.c b/hesiod/nss_hesiod/hesiod-grp.c
index 7e4ecb4906..c06e849c71 100644
--- a/hesiod/nss_hesiod/hesiod-grp.c
+++ b/hesiod/nss_hesiod/hesiod-grp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
@@ -26,8 +26,6 @@
#include <string.h>
#include <sys/param.h>
-#include "nss_hesiod.h"
-
/* Get the declaration of the parser function. */
#define ENTNAME grent
#define STRUCTURE group
@@ -58,8 +56,7 @@ lookup (const char *name, const char *type, struct group *grp,
size_t len;
int olderr = errno;
- context = _nss_hesiod_init ();
- if (context == NULL)
+ if (hesiod_init (&context) < 0)
return NSS_STATUS_UNAVAIL;
list = hesiod_resolve (context, name, type);
@@ -179,8 +176,7 @@ _nss_hesiod_initgroups_dyn (const char *user, gid_t group, long int *start,
gid_t *groups = *groupsp;
int save_errno;
- context = _nss_hesiod_init ();
- if (context == NULL)
+ if (hesiod_init (&context) < 0)
return NSS_STATUS_UNAVAIL;
list = hesiod_resolve (context, user, "grplist");
diff --git a/hesiod/nss_hesiod/hesiod-init.c b/hesiod/nss_hesiod/hesiod-init.c
deleted file mode 100644
index 2315040820..0000000000
--- a/hesiod/nss_hesiod/hesiod-init.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 2000.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/cdefs.h> /* Needs to come before <hesiod.h>. */
-#include <hesiod.h>
-#include <resolv.h>
-#include <stddef.h>
-
-#include "nss_hesiod.h"
-
-void *
-_nss_hesiod_init (void)
-{
- void *context;
-
- if (hesiod_init (&context) == -1)
- return NULL;
-
- /* Use the default (per-thread) resolver state. */
- __hesiod_res_set (context, &_res, NULL);
-
- return context;
-}
diff --git a/hesiod/nss_hesiod/hesiod-proto.c b/hesiod/nss_hesiod/hesiod-proto.c
index 3c59e731ab..cf8813fe80 100644
--- a/hesiod/nss_hesiod/hesiod-proto.c
+++ b/hesiod/nss_hesiod/hesiod-proto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
@@ -25,8 +25,6 @@
#include <stdlib.h>
#include <string.h>
-#include "nss_hesiod.h"
-
/* Declare a parser for Hesiod protocol entries. Although the format
of the entries is identical to those in /etc/protocols, here is no
predefined parser for us to use. */
@@ -68,8 +66,7 @@ lookup (const char *name, const char *type, struct protoent *proto,
int found;
int olderr = errno;
- context = _nss_hesiod_init ();
- if (context == NULL)
+ if (hesiod_init (&context) < 0)
return NSS_STATUS_UNAVAIL;
list = hesiod_resolve (context, name, type);
diff --git a/hesiod/nss_hesiod/hesiod-pwd.c b/hesiod/nss_hesiod/hesiod-pwd.c
index 1ddf3e3c9f..a6f433479d 100644
--- a/hesiod/nss_hesiod/hesiod-pwd.c
+++ b/hesiod/nss_hesiod/hesiod-pwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
@@ -24,8 +24,6 @@
#include <stdlib.h>
#include <string.h>
-#include "nss_hesiod.h"
-
/* Get the declaration of the parser function. */
#define ENTNAME pwent
#define STRUCTURE passwd
@@ -56,8 +54,7 @@ lookup (const char *name, const char *type, struct passwd *pwd,
size_t len;
int olderr = errno;
- context = _nss_hesiod_init ();
- if (context == NULL)
+ if (hesiod_init (&context) < 0)
return NSS_STATUS_UNAVAIL;
list = hesiod_resolve (context, name, type);
diff --git a/hesiod/nss_hesiod/hesiod-service.c b/hesiod/nss_hesiod/hesiod-service.c
index 756345f04e..bfaffcf28a 100644
--- a/hesiod/nss_hesiod/hesiod-service.c
+++ b/hesiod/nss_hesiod/hesiod-service.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
@@ -25,8 +25,6 @@
#include <stdlib.h>
#include <string.h>
-#include "nss_hesiod.h"
-
/* Hesiod uses a format for service entries that differs from the
traditional format. We therefore declare our own parser. */
@@ -69,8 +67,7 @@ lookup (const char *name, const char *type, const char *protocol,
int found;
int olderr = errno;
- context = _nss_hesiod_init ();
- if (context == NULL)
+ if (hesiod_init (&context) < 0)
return NSS_STATUS_UNAVAIL;
list = hesiod_resolve (context, name, type);
diff --git a/hesiod/nss_hesiod/nss_hesiod.h b/hesiod/nss_hesiod/nss_hesiod.h
deleted file mode 100644
index a6ed8ee6a7..0000000000
--- a/hesiod/nss_hesiod/nss_hesiod.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 2000.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Initialize a Hesiod context. */
-extern void *_nss_hesiod_init (void);