xref: /dragonfly/libexec/ypxfr/ypxfr.8 (revision 1de703da)
1.\" Copyright (c) 1995
2.\"	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by Bill Paul.
15.\" 4. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD: src/libexec/ypxfr/ypxfr.8,v 1.10.2.4 2002/12/29 16:35:37 schweikh Exp $
32.\" $DragonFly: src/libexec/ypxfr/ypxfr.8,v 1.2 2003/06/17 04:27:08 dillon Exp $
33.\"
34.Dd February 5, 1995
35.Dt YPXFR 8
36.Os
37.Sh NAME
38.Nm ypxfr
39.Nd "transfer NIS database from remote server to local host"
40.Sh SYNOPSIS
41.Nm /usr/libexec/ypxfr
42.Op Fl f
43.Op Fl c
44.Op Fl d Ar target domain
45.Op Fl h Ar source host
46.Op Fl s Ar source domain
47.Op Fl p Ar path
48.Op Fl C Ar taskid program-number ipaddr port
49.Ar mapname
50.Sh DESCRIPTION
51.Nm Ypxfr
52copies an
53.Tn NIS
54database (or
55.Pa map )
56from one
57.Tn NIS
58server to another using
59.Tn NIS
60services. In
61.Fx ,
62.Nm
63is generally invoked by
64.Xr ypserv 8
65when it receives a map transfer request from
66.Xr yppush 8 .
67.Nm Ypxfr
68is used primarily in environments where several
69.Tn NIS
70servers are in use in a single domain. One server, the
71.Tn NIS
72master, maintains
73the canonical copies of all
74.Tn NIS
75maps, and all the other servers,
76the
77.Tn NIS
78slaves, copy new versions of the maps from the master whenever
79any updates are made (i.e. when a user updates their password via
80.Xr yppasswd 1 ) .
81.Pp
82When run,
83.Nm
84creates a temporary database file in
85.Pa /var/yp/[domainmame] ,
86and fills it with the contents of
87.Ar mapname
88as supplied by the specified
89.Ar source host .
90When the entire map has been transfered,
91.Nm
92deletes the original copy of
93.Ar mapname
94and moves the temporary copy into its place. When the transfer is
95complete,
96.Nm
97will attempt to send a 'clear current map' request to the local
98.Xr ypserv 8
99process to clear any possible references it may still have to the
100stale map.
101.Pp
102Note that all files created by
103.Nm
104are owner readable and writable only for security reasons. Since the
105.Tn NIS
106maps and the directory in which they reside are normally owned by
107root, this prevents non-privileged users from making unauthorized
108modifications.
109.Pp
110In order to maintain consistency across all
111.Tn NIS
112servers,
113.Nm
114can be run periodically in a
115.Xr cron 8
116job. Maps which change infrequently
117need only be updated once a day (preferably late at night when system
118usage is lowest), whereas those that are subject to frequent changes
119(such a
120.Pa passwd.byname
121and
122.Pa passwd.byuid )
123should be updated perhaps once every hour. Using
124.Xr cron 8
125to automatically
126update the
127.Tn NIS
128maps is not strictly mandatory since all updates should
129be propagated by
130.Xr yppush 8
131when
132.Pa /var/yp/Makefile
133is run on the
134.Tn NIS
135master server, however it is good practice
136on large networks where possible outages could cause
137.Tn NIS
138servers to fall out of sync with each other.
139.Pp
140When
141.Nm
142is invoked without a controlling terminal, e.g. from inside
143.Xr ypserv 8 ,
144it logs all its output using the
145.Xr syslog 3
146facility.
147.Sh NOTES
148The
149.Fx
150version of
151.Nm
152has support for a special map transfer protocol which works in
153conjunction with the
154.Fx
155.Xr rpc.ypxfrd 8
156server. This protocol allows it to transfer raw map database files from
157the
158.Tn NIS
159master server and can be many times faster than the standard
160transfer method, particularly for very large
161.Tn NIS
162maps. The
163.Nm
164command will check to see if the
165.Xr rpc.ypxfrd 8
166server is registered on the
167.Tn NIS
168master server and attempt to use
169it if it is present. If it isn't it will fall back to the standard
170transfer method, copying the map contents from
171.Xr ypserv 8
172and creating new maps instead.
173.Pp
174Note that while the
175.Fx
176ypxfrd protocol is conceptually similar
177to the SunOS ypxfrd protocol,
178the
179.Fx
180protocol is not compatible with
181Sun's, therefore it will not work with Sun's ypxfrd server.
182.Fx
183slave systems can still transfer maps from any
184.No non- Ns Fx
185.Tn NIS
186server,
187however they will only be able to take advantage of the faster protocol
188if the master server is also running
189.Fx .
190.Sh OPTIONS
191The following options and flags are supported by
192.Nm :
193.Bl -tag -width indent
194.It Fl f
195Force a map transfer. Normally,
196.Nm
197will not transfer a map if it determines that the
198.Tn NIS
199master's copy
200is not newer than the existing copy already on the local host: the
201.Fl f
202flag forces a transfer regardless of which server's version is more recent.
203.It Fl c
204Do not send a 'clear current map' request to the
205.Xr ypserv 8
206process running on the local host. This flag is normally used when
207invoking
208.Nm
209manually on a machine that is not yet running
210.Xr ypserv 8 .
211Without this flag, failure to contact the local
212.Tn NIS
213server will cause
214.Nm
215to abort the transfer.
216.It Fl d Ar target domain
217Specify a target domain other than the current
218.Tn NIS
219domain.
220.It Fl h Ar source host
221Specify the name of the host from which to copy the
222.Tn NIS
223maps. This option
224is used to insure that
225.Nm
226only copies maps from the
227.Tn NIS
228master server.
229.It Fl s Ar source domain
230Specify the domain from which to transfer a map, in the event that
231the transfer is being done across two different
232.Tn NIS
233domains.
234.It Fl p Ar path
235Specify the top level directory containing the
236.Tn NIS
237maps. By
238default, this path is
239.Pa /var/yp .
240The
241.Fl p
242flag allows you to specify an alternate path should you wish to
243store your
244.Tn NIS
245maps in a different part of the filesystem. The
246.Tn NIS
247server,
248.Xr ypserv 8 ,
249passes this flag to
250.Nm
251if it too has been told to use an alternate path.
252.It Fl C Ar taskid program-number ipaddr port
253These options are used only when
254.Nm
255is invoked by
256.Xr ypserv 8
257in response to a map transfer request initiated by
258.Xr yppush 8 .
259In this instance,
260.Nm
261needs to 'callback' to the
262.Xr yppush 8
263process and interact with it, so
264.Xr yppush 8
265passes to it an IP address
266.Ar ipaddr ,
267port number
268.Ar port ,
269registered program number
270.Ar program-number
271and a transaction ID
272.Ar taskid
273that it can use to contact the waiting
274.Xr yppush 8
275process on the master server.
276.It Ar mapname
277The name of the map to transfer.
278.El
279.Sh FILES
280.Bl -tag -width Pa -compact
281.It Pa /var/yp/[domainname]/[maps]
282The
283.Tn NIS
284maps for a particular
285.Tn NIS
286domain.
287.El
288.Sh SEE ALSO
289.Xr yp 8 ,
290.Xr yppush 8 ,
291.Xr ypserv 8
292.Sh AUTHORS
293.An Bill Paul Aq wpaul@ctr.columbia.edu
294