about summary refs log tree commit diff
path: root/nis/nss_nis/nis-proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-proto.c')
-rw-r--r--nis/nss_nis/nis-proto.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/nis/nss_nis/nis-proto.c b/nis/nss_nis/nis-proto.c
index 6feae63258..ccb95c3c41 100644
--- a/nis/nss_nis/nis-proto.c
+++ b/nis/nss_nis/nis-proto.c
@@ -28,6 +28,11 @@
 
 #include "nss-nis.h"
 
+/* Get the declaration of the parser function.  */
+#define ENTNAME protoent
+#define EXTERN_PARSER
+#include "../nss/nss_files/files-parse.c"
+
 __libc_lock_define_initialized (static, lock)
 
 static bool_t new_start = 1;
@@ -74,6 +79,7 @@ static enum nss_status
 internal_nis_getprotoent_r (struct protoent *proto,
 			    char *buffer, size_t buflen)
 {
+  struct parser_data *data = (void *) buffer;
   char *domain, *result, *outkey;
   int len, keylen, parse_res;
 
@@ -114,7 +120,7 @@ internal_nis_getprotoent_r (struct protoent *proto,
         ++p;
       free (result);
 
-      parse_res = _nss_files_parse_protoent (p, proto, buffer, buflen);
+      parse_res = _nss_files_parse_protoent (p, proto, data, buflen);
       if (!parse_res && errno == ERANGE)
         return NSS_STATUS_TRYAGAIN;
 
@@ -146,6 +152,7 @@ enum nss_status
 _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
 			   char *buffer, size_t buflen)
 {
+  struct parser_data *data = (void *) buffer;
   enum nss_status retval;
   char *domain, *result, *p;
   int len, parse_res;
@@ -182,7 +189,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
     ++p;
   free (result);
 
-  parse_res = _nss_files_parse_protoent (p, proto, buffer, buflen);
+  parse_res = _nss_files_parse_protoent (p, proto, data, buflen);
 
   if (!parse_res)
     {
@@ -199,6 +206,7 @@ enum nss_status
 _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
 			     char *buffer, size_t buflen)
 {
+  struct parser_data *data = (void *) buffer;
   enum nss_status retval;
   char *domain, *result, *p;
   int len, nlen, parse_res;
@@ -232,7 +240,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
     ++p;
   free (result);
 
-  parse_res = _nss_files_parse_protoent (p, proto, buffer, buflen);
+  parse_res = _nss_files_parse_protoent (p, proto, data, buflen);
 
   if (!parse_res)
     {