This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
----------------- Jeff Bastian jmbastia@ti.com Unix System Admin Texas Instruments -----------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Detailed Description
What exactly do our ypbind patches do?
1) There is a chunk of code in the test_bindings() function in
(ypbind-mt-1.12/src/serv_list.c) that tests the current server
for accessibility and finds a new server if its broken. This
chunk of code is inside a while(1) loop that controls the
20sec/15min actions. We've moved this chunk of code to a
function called test_bindings_once() and placed a call to
this new function in test_bindings(), so the functionality
is not changed here.
2) In the ypbindproc_domain() function
(ypbind-mt-1.12/src/ypbind_server.c) there is an added call to
the test_bindings_once() function. If everything is working,
this added test is a small price. If the server is down, it
will look for a new one.So, the only change in behavior here is that ypbindproc_domain() will
test the current binding once before returning. If necessary, a new
command line flag can be added so ypbindproc_domain() only calls
test_bindings_once() if this new flag is present, e.g.
ypbind -no-ping --xyz
...
ypbindproc_domain(...)
{
...
if (xyz)
test_bindings_once(1);
find_domain (domain, result);
...
}However, this is only half the picture. Meanwhile, over in glibc land, more changes are made in the NIS client code to make this whole new system work.
What exactly do our glibc patches do?
1) Like test_bindings() above, we take the __yp_bind() function
(glibc-2.3.2-200309260658/nis/ypclnt.c) and move chunks of it
into three smaller functions.
a) __yp_bind_client_create() is a small chunk of code that
was duplicated in __yp_bind(), once for the section of
code that looks at /var/yp/binding, the other for the
section that talks to the ypbind daemon
b) the section that looks at /var/yp/binding was moved into
the __yp_bind_file() function, with a call to
__yp_bind_client_create() where the duplicate code used
to reside
c) the section that talks to ypbind daemon was moved into
the __yp_bind_ypbindprog() function, again, with a call to
__yp_bind_client_create() replacing the duplicate code
And, of course, calls to __yp_bind_file() and
__yp_bind_ypbindprog() are inserted into __yp_bind() where the
code used to reside. Also, like ypbind change (1) above, this
does not alter the functionality at all.
2) If /var/yp/binding has bad data in it (e.g., a server that went
offline), then calls do_ypcall() will fail w/o trying to find
a new NIS server. So, two lines of code are added to do_ypcall()
that, in the event of an error from clnt_call(), try calling
__yp_bind_ypbindprog() (one of our new functions), which in turn
does
clnt_call (client, YPBINDPROC_DOMAIN, ...)
which in turn calls ypbindproc_domain() in the ypbind daemon
which calls test_bindings_once() and hopefully finds a new
server.In summary, while at first our patches appear to do lots of surgery
to the source code, there's really only two small changes:
1) Call test_bindings_once() from ypbindproc_domain(), possibly
controlled by a new command line flag
2) Call __yp_bind_ypbindprog() from do_ypcall() if clnt_call()
returns an errorAttachment:
nis_patches_rhel3.tar.gz
Description: application/gzip
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |