summaryrefslogtreecommitdiff
path: root/nis/nss_nis/nis-ethers.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-ethers.c')
-rw-r--r--nis/nss_nis/nis-ethers.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/nis/nss_nis/nis-ethers.c b/nis/nss_nis/nis-ethers.c
index ae3ba76adf..25f77f5f82 100644
--- a/nis/nss_nis/nis-ethers.c
+++ b/nis/nss_nis/nis-ethers.c
@@ -33,10 +33,16 @@ __libc_lock_define_initialized (static, lock)
struct ether
{
- char *e_name;
+ const char *e_name;
struct ether_addr e_addr;
};
+/* Get the declaration of the parser function. */
+#define ENTNAME etherent
+#define STRUCTURE ether
+#define EXTERN_PARSER
+#include "../nss/nss_files/files-parse.c"
+
static bool_t new_start = 1;
static char *oldkey = NULL;
static int oldkeylen = 0;
@@ -80,6 +86,7 @@ _nss_nis_endetherent (void)
static enum nss_status
internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
{
+ struct parser_data *data = (void *) buffer;
char *domain, *result, *outkey;
int len, keylen, parse_res;
@@ -120,7 +127,7 @@ internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
++p;
free (result);
- parse_res = _nss_files_parse_etherent (p, eth, buffer, buflen);
+ parse_res = _nss_files_parse_etherent (p, eth, data, buflen);
if (!parse_res && errno == ERANGE)
return NSS_STATUS_TRYAGAIN;
@@ -152,6 +159,7 @@ enum nss_status
_nss_nis_getethernam_r (const char *name, struct ether *eth,
char *buffer, size_t buflen)
{
+ struct parser_data *data = (void *) buffer;
enum nss_status retval;
char *domain, *result, *p;
int len, parse_res;
@@ -188,7 +196,7 @@ _nss_nis_getethernam_r (const char *name, struct ether *eth,
++p;
free (result);
- parse_res = _nss_files_parse_etherent (p, eth, buffer, buflen);
+ parse_res = _nss_files_parse_etherent (p, eth, data, buflen);
if (!parse_res)
{
@@ -205,6 +213,7 @@ enum nss_status
_nss_nis_getetherbyaddr_r (struct ether_addr *addr, struct ether *eth,
char *buffer, size_t buflen)
{
+ struct parser_data *data = (void *) buffer;
enum nss_status retval;
char *domain, *result, *p;
int len, nlen, parse_res;
@@ -250,7 +259,7 @@ _nss_nis_getetherbyaddr_r (struct ether_addr *addr, struct ether *eth,
++p;
free (result);
- parse_res = _nss_files_parse_etherent (p, eth, buffer, buflen);
+ parse_res = _nss_files_parse_etherent (p, eth, data, buflen);
if (!parse_res)
{