189 lines
3.6 KiB
HTML
189 lines
3.6 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>The Client Side of NIS</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux Network Administrators Guide"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="The Network Information System"
|
|
HREF="x-087-2-nis.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="NIS Versus NIS+"
|
|
HREF="x-087-2-nis.nisplus.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Running an NIS Server"
|
|
HREF="x-087-2-nis.server.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux Network Administrators Guide</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-nis.nisplus.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 13. The Network Information System</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-nis.server.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="X-087-2-NIS.CLIENTS"
|
|
>13.3. The Client Side of NIS</A
|
|
></H1
|
|
><P
|
|
>If you are familiar with writing or porting network applications, you
|
|
may notice that most of the NIS maps listed previously correspond to library
|
|
functions in the C library. For instance, to obtain <TT
|
|
CLASS="FILENAME"
|
|
>passwd</TT
|
|
>
|
|
information, you generally use the <TT
|
|
CLASS="FUNCTION"
|
|
>getpwnam</TT
|
|
> and
|
|
<TT
|
|
CLASS="FUNCTION"
|
|
>getpwuid</TT
|
|
> functions, which return the account information
|
|
associated with the given username or numerical user ID, respectively.
|
|
Under normal circumstances, these functions perform the requested
|
|
lookup on the standard file, such as <TT
|
|
CLASS="FILENAME"
|
|
>/etc/passwd</TT
|
|
>.</P
|
|
><P
|
|
>An NIS-aware implementation of these functions, however, modifies this
|
|
behavior and places an RPC call to the NIS server, which looks up the username
|
|
or user ID. This happens transparently to the application. The function may
|
|
treat the NIS data as though it has been appended to the original
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>passwd</TT
|
|
> file so both sets of information are available
|
|
to the application and used, or as though it has completely replaced it so
|
|
that the information in the local <TT
|
|
CLASS="FILENAME"
|
|
>passwd</TT
|
|
> is ignored
|
|
and only the NIS data is used.</P
|
|
><P
|
|
>For traditional NIS implementations, there were certain conventions for
|
|
which maps were replaced and which were appended to the original information.
|
|
Some, like the <TT
|
|
CLASS="FILENAME"
|
|
>passwd</TT
|
|
> maps, required kludgy modifications
|
|
of the <TT
|
|
CLASS="FILENAME"
|
|
>passwd</TT
|
|
> file which, when done incorrectly, would
|
|
open up security holes. To avoid these pitfalls, NYS and the GNU <TT
|
|
CLASS="FILENAME"
|
|
>libc</TT
|
|
> use a
|
|
general configuration scheme that determines whether a particular set of
|
|
client functions uses the original files, NIS, or NIS+, and in which order.
|
|
This scheme will be described later in this chapter.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-nis.nisplus.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-nis.server.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>NIS Versus NIS+</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-nis.html"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Running an NIS Server</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |