Skip to content

Commit

Permalink
* nis/nis_call.c (__prepare_niscall): New function. Split out
Browse files Browse the repository at this point in the history
	from __do_niscall.
	* nis/nis_table.c (__create_ib_request): Renamed from create_ib_request
	and exported.
	(__follow_path): New function.  Split out from nis_list.
	* nis/nis_xdr.h: Add libnsl_hidden_proto for _xdr_ib_request and
	_xdr_nis_result.
	* nis/nis_xdr.c: Add libnsl_hidden_def for _xdr_ib_request and
	_xdr_nis_result.
	* nis/libnsl.h: Declare __prepare_niscall, __create_ib_request,
	and __follow_path.
	* nis/Versions: Export __prepare_niscall, __create_ib_request,
	__follow_path, __do_niscall3, _xdr_ib_request, and _xdr_nis_result
	from libnsl for version GLIBC_PRIVATE.
	* nis/nisplus-parser.h: Remove _nss_nisplus_parse_pwent_chk.
	Remove entry parameter from _nss_nisplus_parse_pwent and
	_nss_nisplus_parse_grent.
	* nis/nss_nisplus/nisplus-parser.c: Likewise.
	* nis/nss_nisplus/nisplus-pwd.c: Remove support for SETENT_BATCH_READ
	again.  Rewrite getpwent handling to not use nis_first_entry and
	nis_next_entry.  Roll out own niscall handling.
	* nis/nss_nisplus/nisplus-grp.c: Likewise.

	* sunrpc/xdr_rec.c: Fix typo in comment.

2006-05-18  David Woodhouse  <dwmw2@redhat.com>
  • Loading branch information
Ulrich Drepper committed May 20, 2006
1 parent 1d4f062 commit a17fa61
Show file tree
Hide file tree
Showing 12 changed files with 479 additions and 358 deletions.
29 changes: 28 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
2006-05-20 Ulrich Drepper <drepper@redhat.com>

* nis/nis_call.c (__prepare_niscall): New function. Split out
from __do_niscall.
* nis/nis_table.c (__create_ib_request): Renamed from create_ib_request
and exported.
(__follow_path): New function. Split out from nis_list.
* nis/nis_xdr.h: Add libnsl_hidden_proto for _xdr_ib_request and
_xdr_nis_result.
* nis/nis_xdr.c: Add libnsl_hidden_def for _xdr_ib_request and
_xdr_nis_result.
* nis/libnsl.h: Declare __prepare_niscall, __create_ib_request,
and __follow_path.
* nis/Versions: Export __prepare_niscall, __create_ib_request,
__follow_path, __do_niscall3, _xdr_ib_request, and _xdr_nis_result
from libnsl for version GLIBC_PRIVATE.
* nis/nisplus-parser.h: Remove _nss_nisplus_parse_pwent_chk.
Remove entry parameter from _nss_nisplus_parse_pwent and
_nss_nisplus_parse_grent.
* nis/nss_nisplus/nisplus-parser.c: Likewise.
* nis/nss_nisplus/nisplus-pwd.c: Remove support for SETENT_BATCH_READ
again. Rewrite getpwent handling to not use nis_first_entry and
nis_next_entry. Roll out own niscall handling.
* nis/nss_nisplus/nisplus-grp.c: Likewise.

* sunrpc/xdr_rec.c: Fix typo in comment.

2006-05-19 Ulrich Drepper <drepper@redhat.com>

* nis/nis_call.c (__do_niscall3): Avoid code duplication in error
Expand Down Expand Up @@ -30,7 +57,7 @@
cb->serv together. Remove now obsolete free calls.
(__nis_destroy_callback): Remove now obsolete free call.

2006-05-18 David Woodhouse <dwmw2@infradead.org>
2006-05-18 David Woodhouse <dwmw2@redhat.com>

* sysdeps/posix/getaddrinfo.c: Add unique labels to the default
RFC3484 precedence table for fec0::/10 and fc00::/7 (site-local
Expand Down
3 changes: 2 additions & 1 deletion nis/Versions
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ libnsl {
xdr_ypall;
}
GLIBC_PRIVATE {
_nsl_default_nss;
_nsl_default_nss; __prepare_niscall; __follow_path; __do_niscall3;
__create_ib_request; _xdr_ib_request; _xdr_nis_result;
}
}

Expand Down
14 changes: 14 additions & 0 deletions nis/libnsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <rpcsvc/nis.h>

#define NSS_FLAG_NETID_AUTHORITATIVE 1
#define NSS_FLAG_SERVICES_AUTHORITATIVE 2
#define NSS_FLAG_SETENT_BATCH_READ 4


/* Get current set of default flags. */
extern int _nsl_default_nss (void);

/* Set up everything for a call to __do_niscall3. */
extern nis_error __prepare_niscall (const_nis_name name, directory_obj **dirp,
dir_binding *bptrp, unsigned int flags);

extern struct ib_request *__create_ib_request (const_nis_name name,
unsigned int flags);
libnsl_hidden_proto (__create_ib_request)

extern nis_error __follow_path (char **tablepath, char **tableptr,
struct ib_request *ibreq, dir_binding *bptr);
libnsl_hidden_proto (__follow_path)
68 changes: 43 additions & 25 deletions nis/nis_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,50 +531,68 @@ __nisfind_server (const_nis_name name, directory_obj **dir)
return result;
}


nis_error
__do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
caddr_t req, xdrproc_t xres, caddr_t resp, unsigned int flags,
nis_cb *cb)
__prepare_niscall (const_nis_name name, directory_obj **dirp,
dir_binding *bptrp, unsigned int flags)
{
nis_error retcode;
dir_binding bptr;
directory_obj *dir = NULL;
nis_error retcode = __nisfind_server (name, dirp);
if (__builtin_expect (retcode != NIS_SUCCESS, 0))
return retcode;

nis_server *server;
u_int server_len;
int saved_errno = errno;

retcode = __nisfind_server (name, &dir);
if (retcode != NIS_SUCCESS)
return retcode;

if (flags & MASTER_ONLY)
{
server = dir->do_servers.do_servers_val;
server = (*dirp)->do_servers.do_servers_val;
server_len = 1;
}
else
{
server = dir->do_servers.do_servers_val;
server_len = dir->do_servers.do_servers_len;
server = (*dirp)->do_servers.do_servers_val;
server_len = (*dirp)->do_servers.do_servers_len;
}

retcode = __nisbind_create (&bptr, server, server_len, flags);
retcode = __nisbind_create (bptrp, server, server_len, flags);
if (retcode == NIS_SUCCESS)
{
do
if (__nisbind_connect (bptrp) == NIS_SUCCESS)
return NIS_SUCCESS;
while (__nisbind_next (bptrp) == NIS_SUCCESS);

__nisbind_destroy (bptrp);
memset (bptrp, '\0', sizeof (*bptrp));

retcode = NIS_NAMEUNREACHABLE;
}

nis_free_directory (*dirp);
*dirp = NULL;

return retcode;
}


nis_error
__do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
caddr_t req, xdrproc_t xres, caddr_t resp, unsigned int flags,
nis_cb *cb)
{
dir_binding bptr;
directory_obj *dir = NULL;
int saved_errno = errno;

nis_error retcode = __prepare_niscall (name, &dir, &bptr, flags);
if (retcode == NIS_SUCCESS)
{
while (__nisbind_connect (&bptr) != NIS_SUCCESS)
{
if (__nisbind_next (&bptr) != NIS_SUCCESS)
{
nis_free_directory (dir);
return NIS_NAMEUNREACHABLE;
}
}
retcode = __do_niscall3 (&bptr, prog, xargs, req, xres, resp, flags, cb);

__nisbind_destroy (&bptr);
}

nis_free_directory (dir);
nis_free_directory (dir);
}

__set_errno (saved_errno);

Expand Down
Loading

0 comments on commit a17fa61

Please sign in to comment.