summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-05-10 23:37:32 +0000
committerUlrich Drepper <drepper@redhat.com>1997-05-10 23:37:32 +0000
commit43b0e40f85770cd1f362c3abbad41e09bd9f0b17 (patch)
tree799af104f1ab7419ac37f0d9a8d5d34a73bba54b /nis
parent8b13cb56b3433bed5233840af66127a745c27718 (diff)
downloadglibc-43b0e40f85770cd1f362c3abbad41e09bd9f0b17.tar.gz
glibc-43b0e40f85770cd1f362c3abbad41e09bd9f0b17.tar.xz
glibc-43b0e40f85770cd1f362c3abbad41e09bd9f0b17.zip
1997-05-10 11:46  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* nis/rpcsvc/nis_callback.x: New, from tirpcsrc-2.3.

	* nis/nis_call.c (__nis_docall): Rewritten for navigation in NIS+
	namespace hierachy.
	* nis/nis_intern.h: Add new __nis_docall function prototypes.
	* nis/nis_add.c: Change __nis_docall/__nis_docall2 parameters for new
	rewritten functions.
	* nis/nis_checkpoint.c: Likewise.
	* nis/nis_lookup.c: Likewise.
	* nis/nis_mkdir.c: Likewise.
	* nis/nis_modify.c: Likewise.
	* nis/nis_ping.c: Likewise.
	* nis/nis_remove.c: Likewise.
	* nis/nis_rmdir.c: Likewise.
	* nis/nis_server.c: Likewise.
	* nis/nis_table.c: Likewise.

1997-05-09 16:09  Miles Bader  <miles@gnu.ai.mit.edu>

	* argp/argp-eexst.c: Include <sysexits.h>.
	(argp_err_exit_status): Initialize to EX_USAGE.
	* argp/argp.h, argp/argp-help.c: Doc fixes.

1997-05-08 17:15  Miles Bader  <miles@gnu.ai.mit.edu>

	* argp/argp.h [!__error_t_defined] (__error_t_defined): Define.
	* argp/argp-help.c (canon_doc_option): Correct ctype tests.
Diffstat (limited to 'nis')
-rw-r--r--nis/TODO6
-rw-r--r--nis/nis_add.c3
-rw-r--r--nis/nis_call.c211
-rw-r--r--nis/nis_checkpoint.c2
-rw-r--r--nis/nis_intern.h9
-rw-r--r--nis/nis_lookup.c4
-rw-r--r--nis/nis_mkdir.c10
-rw-r--r--nis/nis_modify.c2
-rw-r--r--nis/nis_ping.c9
-rw-r--r--nis/nis_remove.c2
-rw-r--r--nis/nis_rmdir.c10
-rw-r--r--nis/nis_server.c16
-rw-r--r--nis/nis_table.c22
-rw-r--r--nis/rpcsvc/nis_callback.x65
14 files changed, 301 insertions, 70 deletions
diff --git a/nis/TODO b/nis/TODO
index 33072fa730..f87b02a407 100644
--- a/nis/TODO
+++ b/nis/TODO
@@ -1,12 +1,6 @@
 
  * nss_nisplus: When using parser form nss_files, rewrite parser
 
- * nss_nisplus: Search the data in the complete NIS+ namespace
-		specified by NIS_PATH
- 
- * What does nis_list give back, if rpc.nisd is not running or
-   if /var/nis/NIS_START_FILE does not exist ?
-
  * nis_table.c: nis_list(): 
 	Missing flags: FOLLOW_PATH, ALL_RESULTS
 	callback: Don't simulate it, use server callback thread
diff --git a/nis/nis_add.c b/nis/nis_add.c
index 0eb838efed..6e11f17ff6 100644
--- a/nis/nis_add.c
+++ b/nis/nis_add.c
@@ -55,7 +55,8 @@ nis_add (const_nis_name name, const nis_object *obj)
   req.ns_object.ns_object_val[0].zo_domain =
     nis_domain_of_r (name, buf4, sizeof (buf4));
 
-  if ((status = __do_niscall (NULL, 0, NIS_ADD, (xdrproc_t) xdr_ns_request,
+  if ((status = __do_niscall (req.ns_object.ns_object_val[0].zo_domain,
+			      NIS_ADD, (xdrproc_t) xdr_ns_request,
 			      (caddr_t) &req, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, MASTER_ONLY)) != RPC_SUCCESS)
     res->status = status;
diff --git a/nis/nis_call.c b/nis/nis_call.c
index a92f1445f4..17f67abbde 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -160,36 +160,19 @@ __nis_dobind (const nis_server *server, u_long flags)
 }
 
 nis_error
-__do_niscall (const nis_server *serv, int serv_len, u_long prog,
-	      xdrproc_t xargs, caddr_t req, xdrproc_t xres, caddr_t resp,
-	      u_long flags)
+__do_niscall2 (const nis_server *server, u_int server_len, u_long prog,
+	       xdrproc_t xargs, caddr_t req, xdrproc_t xres, caddr_t resp,
+	       u_long flags)
 {
   CLIENT *clnt;
-  directory_obj *dir = NULL;
-  const nis_server *server;
   int try, result;
-  unsigned int server_len;
 
-  if (serv == NULL || serv_len == 0)
-    {
-      dir = readColdStartFile ();
-      if (dir == NULL) /* No /var/nis/NIS_COLD_START -> no NIS+ installed */
-	return NIS_UNAVAIL;
-      server = dir->do_servers.do_servers_val;
-      server_len = dir->do_servers.do_servers_len;
-    }
-  else
-    {
-      server = serv;
-      server_len = serv_len;
-    }
+  try = 0;
+  result = NIS_NAMEUNREACHABLE;
 
   if (((flags & MASTER_ONLY) == MASTER_ONLY) && server_len > 1)
     server_len = 1; /* The first entry is the master */
 
-  try = 0;
-  result = NIS_NAMEUNREACHABLE;
-
   while (try < MAXTRIES && result != RPC_SUCCESS)
     {
       unsigned int i;
@@ -215,7 +198,191 @@ __do_niscall (const nis_server *serv, int serv_len, u_long prog,
 	}
     }
 
+  return result;
+}
+
+static directory_obj *
+dir_lookup (const_nis_name name, nis_server *serv, u_long flags)
+{
+  CLIENT *clnt;
+  int try, result;
+  nis_result *res;
+  struct ns_request req;
+  directory_obj *dir;
+
+  res = calloc (1, sizeof (nis_result));
+  req.ns_name = (char *)name;
+  req.ns_object.ns_object_len = 0;
+  req.ns_object.ns_object_val = NULL;
+  try = 0;
+  result = NIS_NAMEUNREACHABLE;
+
+  while (try < MAXTRIES && result != RPC_SUCCESS)
+    {
+      if ((clnt = __nis_dobind (serv, flags)) == NULL)
+	continue;
+
+      result = clnt_call (clnt, NIS_LOOKUP, (xdrproc_t) xdr_ns_request,
+			  (caddr_t) &req, (xdrproc_t) xdr_nis_result,
+			  (caddr_t) res, TIMEOUT);
+
+      if (result != RPC_SUCCESS)
+	{
+	  clnt_perror (clnt, "do_niscall: clnt_call");
+	  clnt_destroy (clnt);
+	  result = NIS_RPCERROR;
+	}
+      else
+	clnt_destroy (clnt);
+    }
+  if (result != RPC_SUCCESS || res->status != NIS_SUCCESS)
+    return NULL;
+
+  dir = nis_clone_directory (&res->objects.objects_val->DI_data, NULL);
+  nis_freeresult (res);
+
+  return dir;
+}
+
+static directory_obj *
+rec_dirsearch (const_nis_name name, directory_obj *dir, u_long flags)
+{
+  char domain [strlen (name) + 3];
+
+  nis_domain_of_r (name, domain, sizeof (domain));
+  if (strncmp (domain, "org_dir.", 8) == 0)
+    {
+      char tmp[strlen (name) + 3];
+
+      nis_domain_of_r (domain, tmp, sizeof (tmp));
+      strcpy (domain, tmp);
+    }
+  else
+    if (strncmp (domain, "groups_dir.", 11) == 0)
+      {
+	char tmp[strlen (name) + 3];
+
+	nis_domain_of_r (domain, tmp, sizeof (tmp));
+	strcpy (domain, tmp);
+      }
+    else
+      {
+	/* We have no grous_dir or org_dir, so try the complete name */
+	strcpy (domain, name);
+      }
+
+  switch (nis_dir_cmp (domain, dir->do_name))
+    {
+    case SAME_NAME:
+      return dir;
+    case NOT_SEQUENTIAL:
+      /* NOT_SEQUENTIAL means, go one up and try it there ! */
+    case HIGHER_NAME:
+      { /* We need data from a parent domain */
+	directory_obj *obj;
+	char ndomain [strlen (name) + 3];
+
+	nis_domain_of_r (dir->do_name, ndomain, sizeof (ndomain));
+
+	/* The root server of our domain is a replica of the parent
+	   domain ! (Now I understand why a root server must be a
+	   replica of the parent domain) */
+	obj = dir_lookup (ndomain, dir->do_servers.do_servers_val,
+			  flags);
+	if (obj != NULL)
+	  {
+	    /* We have found a NIS+ server serving ndomain, now
+	       let us search for "name" */
+	    nis_free_directory (dir);
+	    return rec_dirsearch (name, obj, flags);
+	  }
+	else
+	  {
+	    /* Ups, very bad. Are we already the root server ? */
+	    nis_free_directory (dir);
+	    return NULL;
+	  }
+      }
+      break;
+    case LOWER_NAME:
+      {
+	directory_obj *obj;
+	char leaf [strlen (name) + 3];
+	char ndomain [strlen (name) + 3];
+	u_int i;
+
+	do
+	  {
+	    if (strlen (domain) == 0)
+	      {
+		nis_free_directory (dir);
+		return NULL;
+	      }
+	    nis_leaf_of_r (domain, leaf, sizeof (leaf));
+	    nis_domain_of_r (domain, ndomain, sizeof (ndomain));
+	    strcpy (domain, ndomain);
+	  }
+	while (nis_dir_cmp (domain, dir->do_name) != SAME_NAME);
+	strcat (leaf, ".");
+	strcat (leaf, domain);
+
+	for (i = 0; i < dir->do_servers.do_servers_len; ++i)
+	  {
+	    obj = dir_lookup (leaf, &dir->do_servers.do_servers_val[i],
+			      flags);
+	    if (obj != NULL)
+	      {
+		/* We have found a NIS+ server serving ndomain, now
+		   let us search for "name" */
+		nis_free_directory (dir);
+		return rec_dirsearch (name, obj, flags);
+	      }
+	  }
+      }
+      break;
+    case BAD_NAME:
+      nis_free_directory (dir);
+      return NULL;
+    }
+  nis_free_directory (dir);
+  return NULL;
+}
+
+nis_error
+__do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
+	      caddr_t req, xdrproc_t xres, caddr_t resp, u_long flags)
+{
+  nis_error result;
+  directory_obj *dir = NULL;
+  const nis_server *server;
+  u_int server_len;
+
+
+  dir = readColdStartFile ();
+  if (dir == NULL) /* No /var/nis/NIS_COLD_START -> no NIS+ installed */
+    return NIS_UNAVAIL;
+
+  if (name != NULL)
+    {
+      dir = rec_dirsearch (name, dir, flags);
+      if (dir == NULL)
+	{
+	  if (nis_dir_cmp (nis_local_directory(), name) == NOT_SEQUENTIAL)
+	    return NIS_NAMEUNREACHABLE;
+	  else
+	    return NIS_NOTFOUND;
+	}
+    }
+  server = dir->do_servers.do_servers_val;
+  server_len = dir->do_servers.do_servers_len;
+
+  if (((flags & MASTER_ONLY) == MASTER_ONLY) && server_len > 1)
+    server_len = 1; /* The first entry is the master */
+
+  result = __do_niscall2 (server, server_len, prog, xargs, req, xres,
+			  resp, flags);
   if (dir != NULL)
     nis_free_directory (dir);
+
   return result;
 }
diff --git a/nis/nis_checkpoint.c b/nis/nis_checkpoint.c
index 56e98b2ac5..ff0a9b37a7 100644
--- a/nis/nis_checkpoint.c
+++ b/nis/nis_checkpoint.c
@@ -50,7 +50,7 @@ nis_checkpoint(const_nis_name dirname)
 	   i < res2->objects.objects_val[0].DI_data.do_servers.do_servers_len;
 	   ++i)
 	{
-	  if (__do_niscall (&res2->objects.objects_val[0].DI_data.do_servers.do_servers_val[i],
+	  if (__do_niscall2 (&res2->objects.objects_val[0].DI_data.do_servers.do_servers_val[i],
 			    1, NIS_CHECKPOINT, (xdrproc_t) xdr_nis_name,
 			    (caddr_t) &dirname, (xdrproc_t) xdr_cp_result,
 			    (caddr_t) &cpres, 0) != RPC_SUCCESS)
diff --git a/nis/nis_intern.h b/nis/nis_intern.h
index 855a7cab51..25c88a2b22 100644
--- a/nis/nis_intern.h
+++ b/nis/nis_intern.h
@@ -24,9 +24,12 @@
 
 __BEGIN_DECLS
 
-extern nis_error __do_niscall (__const nis_server *server, int server_len,
-			       u_long prog, xdrproc_t xargs, caddr_t req,
-			       xdrproc_t xres, caddr_t resp, u_long flags);
+extern nis_error __do_niscall2 (const nis_server *server, u_int server_len,
+				u_long prog, xdrproc_t xargs, caddr_t req,
+				xdrproc_t xres, caddr_t resp, u_long flags);
+extern nis_error __do_niscall (const_nis_name name, u_long prog,
+			       xdrproc_t xargs, caddr_t req, xdrproc_t xres,
+			       caddr_t resp, u_long flags);
 #if defined (HAVE_SECURE_RPC)
 extern AUTH *authdes_pk_create (const char *, const netobj *, u_int,
 				struct sockaddr *, des_block *);
diff --git a/nis/nis_lookup.c b/nis/nis_lookup.c
index 9173437bfa..6f5b12b285 100644
--- a/nis/nis_lookup.c
+++ b/nis/nis_lookup.c
@@ -56,7 +56,7 @@ nis_lookup (const_nis_name name, const u_long flags)
 	      req.ns_object.ns_object_val = NULL;
 	      memset (res, '\0', sizeof (nis_result));
 
-	      if ((status = __do_niscall (NULL, 0, NIS_LOOKUP,
+	      if ((status = __do_niscall (req.ns_name, NIS_LOOKUP,
 					  (xdrproc_t) xdr_ns_request,
 					  (caddr_t) & req,
 					  (xdrproc_t) xdr_nis_result,
@@ -113,7 +113,7 @@ nis_lookup (const_nis_name name, const u_long flags)
 	  req.ns_object.ns_object_val = NULL;
 	  memset (res, '\0', sizeof (nis_result));
 
-	  if ((status = __do_niscall (NULL, 0, NIS_LOOKUP,
+	  if ((status = __do_niscall (req.ns_name, NIS_LOOKUP,
 				      (xdrproc_t) xdr_ns_request,
 				      (caddr_t) &req,
 				      (xdrproc_t) xdr_nis_result,
diff --git a/nis/nis_mkdir.c b/nis/nis_mkdir.c
index a781c041ba..685dae64aa 100644
--- a/nis/nis_mkdir.c
+++ b/nis/nis_mkdir.c
@@ -28,17 +28,17 @@ nis_mkdir (const_nis_name dir, const nis_server *server)
 
   if (server == NULL)
     {
-      if (__do_niscall (NULL, 0, NIS_MKDIR, (xdrproc_t) xdr_nis_name,
+      if (__do_niscall (dir, NIS_MKDIR, (xdrproc_t) xdr_nis_name,
 			(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
 			(caddr_t) &res, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   else
     {
-      if (__do_niscall (server, 1, NIS_MKDIR,
-			(xdrproc_t) xdr_nis_name,
-			(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
-			(caddr_t) &res, 0) != RPC_SUCCESS)
+      if (__do_niscall2 (server, 1, NIS_MKDIR,
+			 (xdrproc_t) xdr_nis_name,
+			 (caddr_t) &dir, (xdrproc_t) xdr_nis_error,
+			 (caddr_t) &res, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
 
diff --git a/nis/nis_modify.c b/nis/nis_modify.c
index 9c371c03bc..9c5aad7913 100644
--- a/nis/nis_modify.c
+++ b/nis/nis_modify.c
@@ -36,7 +36,7 @@ nis_modify (const_nis_name name, const nis_object *obj)
   req.ns_object.ns_object_len = 1;
   req.ns_object.ns_object_val = nis_clone_object (obj, NULL);
 
-  if ((status = __do_niscall (NULL, 0, NIS_MODIFY, (xdrproc_t) xdr_ns_request,
+  if ((status = __do_niscall (name, NIS_MODIFY, (xdrproc_t) xdr_ns_request,
 			      (caddr_t) & req, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, MASTER_ONLY)) != RPC_SUCCESS)
     res->status = status;
diff --git a/nis/nis_ping.c b/nis/nis_ping.c
index 0aa56ed37e..610cf03ea5 100644
--- a/nis/nis_ping.c
+++ b/nis/nis_ping.c
@@ -53,11 +53,10 @@ nis_ping (const_nis_name dirname, u_long utime, const nis_object *dirobj)
   args.stamp = utime;
 
   for (i = 0; i < obj->DI_data.do_servers.do_servers_len; ++i)
-    __do_niscall (&obj->DI_data.do_servers.do_servers_val[i], 1,
-		  NIS_PING, (xdrproc_t) xdr_ping_args,
-		  (caddr_t) &args, (xdrproc_t) xdr_void,
-		  (caddr_t) NULL, 0);
-
+    __do_niscall2 (&obj->DI_data.do_servers.do_servers_val[i], 1,
+		   NIS_PING, (xdrproc_t) xdr_ping_args,
+		   (caddr_t) &args, (xdrproc_t) xdr_void,
+		   (caddr_t) NULL, 0);
   if (res)
     nis_freeresult (res);
 }
diff --git a/nis/nis_remove.c b/nis/nis_remove.c
index 0415dca731..3ffd66dfe0 100644
--- a/nis/nis_remove.c
+++ b/nis/nis_remove.c
@@ -44,7 +44,7 @@ nis_remove (const_nis_name name, const nis_object *obj)
       req.ns_object.ns_object_val = NULL;
     }
 
-  if ((status = __do_niscall (NULL, 0, NIS_REMOVE, (xdrproc_t) xdr_ns_request,
+  if ((status = __do_niscall (name, NIS_REMOVE, (xdrproc_t) xdr_ns_request,
 			      (caddr_t) & req, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, MASTER_ONLY)) != RPC_SUCCESS)
     res->status = status;
diff --git a/nis/nis_rmdir.c b/nis/nis_rmdir.c
index 5b6f1d181b..a8c239ec70 100644
--- a/nis/nis_rmdir.c
+++ b/nis/nis_rmdir.c
@@ -28,17 +28,17 @@ nis_rmdir (const_nis_name dir, const nis_server *server)
 
   if (server == NULL)
     {
-      if (__do_niscall (NULL, 0, NIS_RMDIR, (xdrproc_t) xdr_nis_name,
+      if (__do_niscall (dir, NIS_RMDIR, (xdrproc_t) xdr_nis_name,
 			(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
 			(caddr_t) &res, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   else
     {
-      if (__do_niscall (server, 1, NIS_RMDIR,
-			(xdrproc_t) xdr_nis_name,
-			(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
-			(caddr_t) &res, 0) != RPC_SUCCESS)
+      if (__do_niscall2 (server, 1, NIS_RMDIR,
+			 (xdrproc_t) xdr_nis_name,
+			 (caddr_t) &dir, (xdrproc_t) xdr_nis_error,
+			 (caddr_t) &res, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
 
diff --git a/nis/nis_server.c b/nis/nis_server.c
index 393f6c6eb4..4d6b1c1100 100644
--- a/nis/nis_server.c
+++ b/nis/nis_server.c
@@ -37,16 +37,16 @@ nis_servstate (const nis_server *serv, const nis_tag *tags,
 
   if (serv == NULL)
     {
-      if (__do_niscall (NULL, 0, NIS_SERVSTATE, (xdrproc_t) xdr_nis_taglist,
+      if (__do_niscall (NULL, NIS_SERVSTATE, (xdrproc_t) xdr_nis_taglist,
 			(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
 			(caddr_t) &tagres, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   else
     {
-      if (__do_niscall (serv, 1, NIS_SERVSTATE, (xdrproc_t) xdr_nis_taglist,
-			(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
-			(caddr_t) &tagres, 0) != RPC_SUCCESS)
+      if (__do_niscall2 (serv, 1, NIS_SERVSTATE, (xdrproc_t) xdr_nis_taglist,
+			 (caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
+			 (caddr_t) &tagres, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   if (tagres.tags.tags_len > 0)
@@ -84,16 +84,16 @@ nis_stats (const nis_server *serv, const nis_tag *tags,
 
   if (serv == NULL)
     {
-      if (__do_niscall (NULL, 0, NIS_STATUS, (xdrproc_t) xdr_nis_taglist,
+      if (__do_niscall (NULL, NIS_STATUS, (xdrproc_t) xdr_nis_taglist,
 			(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
 			(caddr_t) &tagres, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   else
     {
-      if (__do_niscall (serv, 1, NIS_STATUS, (xdrproc_t) xdr_nis_taglist,
-			(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
-			(caddr_t) &tagres, 0) != RPC_SUCCESS)
+      if (__do_niscall2 (serv, 1, NIS_STATUS, (xdrproc_t) xdr_nis_taglist,
+			 (caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
+			 (caddr_t) &tagres, 0) != RPC_SUCCESS)
 	return NIS_RPCERROR;
     }
   if (tagres.tags.tags_len > 0)
diff --git a/nis/nis_table.c b/nis/nis_table.c
index 268ea2f76c..5fa3c89e0b 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -197,9 +197,9 @@ nis_list (const_nis_name name, u_long flags,
     {
       memset (res, '\0', sizeof (nis_result));
 
-      if ((result = __do_niscall (NULL, 0, NIS_IBLIST,
+      if ((result = __do_niscall (ibreq.ibr_name, NIS_IBLIST,
 				  (xdrproc_t) xdr_ib_request,
-			      (caddr_t) & ibreq, (xdrproc_t) xdr_nis_result,
+				  (caddr_t) &ibreq, (xdrproc_t) xdr_nis_result,
 				  (caddr_t) res, flags)) != RPC_SUCCESS)
 	{
 	  res->status = result;
@@ -276,9 +276,9 @@ nis_add_entry (const_nis_name name, const nis_object *obj,
   ibreq.ibr_obj.ibr_obj_val = nis_clone_object (obj, NULL);
   ibreq.ibr_obj.ibr_obj_len = 1;
 
-  if ((status = __do_niscall (NULL, 0, NIS_IBADD,
+  if ((status = __do_niscall (ibreq.ibr_name, NIS_IBADD,
 			      (xdrproc_t) xdr_ib_request,
-			      (caddr_t) & ibreq,
+			      (caddr_t) &ibreq,
 			      (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, 0)) != RPC_SUCCESS)
     res->status = status;
@@ -308,7 +308,7 @@ nis_modify_entry (const_nis_name name, const nis_object *obj,
   ibreq.ibr_obj.ibr_obj_val = nis_clone_object (obj, NULL);
   ibreq.ibr_obj.ibr_obj_len = 1;
 
-  if ((status = __do_niscall (NULL, 0, NIS_IBMODIFY,
+  if ((status = __do_niscall (ibreq.ibr_name, NIS_IBMODIFY,
 			      (xdrproc_t) xdr_ib_request,
 			      (caddr_t) & ibreq, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, 0)) != RPC_SUCCESS)
@@ -342,7 +342,7 @@ nis_remove_entry (const_nis_name name, const nis_object *obj,
       ibreq.ibr_obj.ibr_obj_len = 1;
     }
 
-  if ((status = __do_niscall (NULL, 0, NIS_IBREMOVE,
+  if ((status = __do_niscall (ibreq.ibr_name, NIS_IBREMOVE,
 			      (xdrproc_t) xdr_ib_request,
 			      (caddr_t) & ibreq, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, 0)) != RPC_SUCCESS)
@@ -368,8 +368,9 @@ nis_first_entry (const_nis_name name)
       return res;
     }
 
-  if ((status = __do_niscall (NULL, 0, NIS_IBFIRST, (xdrproc_t) xdr_ib_request,
-			      (caddr_t) & ibreq, (xdrproc_t) xdr_nis_result,
+  if ((status = __do_niscall (ibreq.ibr_name, NIS_IBFIRST,
+			      (xdrproc_t) xdr_ib_request,
+			      (caddr_t) &ibreq, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, 0)) != RPC_SUCCESS)
     res->status = status;
 
@@ -406,8 +407,9 @@ nis_next_entry (const_nis_name name, const netobj *cookie)
       ibreq.ibr_cookie.n_len = cookie->n_len;
     }
 
-  if ((status = __do_niscall (NULL, 0, NIS_IBNEXT, (xdrproc_t) xdr_ib_request,
-			      (caddr_t) & ibreq, (xdrproc_t) xdr_nis_result,
+  if ((status = __do_niscall (ibreq.ibr_name, NIS_IBNEXT,
+			      (xdrproc_t) xdr_ib_request,
+			      (caddr_t) &ibreq, (xdrproc_t) xdr_nis_result,
 			      (caddr_t) res, 0)) != RPC_SUCCESS)
     res->status = status;
 
diff --git a/nis/rpcsvc/nis_callback.x b/nis/rpcsvc/nis_callback.x
new file mode 100644
index 0000000000..48178655cf
--- /dev/null
+++ b/nis/rpcsvc/nis_callback.x
@@ -0,0 +1,65 @@
+%/*
+% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+% * unrestricted use provided that this legend is included on all tape
+% * media and as a part of the software program in whole or part.  Users
+% * may copy or modify Sun RPC without charge, but are not authorized
+% * to license or distribute it to anyone else except as part of a product or
+% * program developed by the user or with the express written consent of
+% * Sun Microsystems, Inc.
+% *
+% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+% *
+% * Sun RPC is provided with no support and without any obligation on the
+% * part of Sun Microsystems, Inc. to assist in its use, correction,
+% * modification or enhancement.
+% *
+% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+% * OR ANY PART THEREOF.
+% *
+% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+% * or profits or other special, indirect and consequential damages, even if
+% * Sun has been advised of the possibility of such damages.
+% *
+% * Sun Microsystems, Inc.
+% * 2550 Garcia Avenue
+% * Mountain View, California  94043
+% */
+
+/*
+ *	nis_callback.x
+ *
+ *	Copyright (c) 1988-1992 Sun Microsystems Inc
+ *	All Rights Reserved.
+ */
+
+%#pragma ident	"@(#)nis_callback.x	1.7	94/05/03 SMI"
+
+/*
+ * "@(#)zns_cback.x 1.2 90/09/10 Copyr 1990 Sun Micro" 
+ *
+ * RPCL description of the Callback Service.
+ */
+
+#ifdef RPC_HDR
+%#include <rpcsvc/nis.h>
+#endif
+#ifdef RPC_XDR
+%#include "nis_clnt.h"
+#endif
+
+typedef nis_object	*obj_p;
+
+struct cback_data {
+	obj_p		entries<>;	/* List of objects */
+};
+
+program CB_PROG {
+	version CB_VERS {
+		bool	CBPROC_RECEIVE(cback_data) = 1;
+		void	CBPROC_FINISH(void) = 2;
+		void	CBPROC_ERROR(nis_error) = 3;
+	} = 1;
+} = 100302;