149586da48bc3ef316ee261f23f273eb6b01234b
[dragonfly.git] / usr.sbin / rpc.ypxfrd / rpc.ypxfrd.8
1 .\" Copyright (c) 1995, 1996
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 author nor the names of 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/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8,v 1.9.2.3 2003/03/11 22:31:32 trhodes Exp $
32 .\" $DragonFly: src/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8,v 1.7 2008/11/23 21:55:52 swildner Exp $
33 .\"
34 .Dd June 2, 1996
35 .Dt RPC.YPXFRD 8
36 .Os
37 .Sh NAME
38 .Nm rpc.ypxfrd
39 .Nd "NIS map transfer server"
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl p Ar path
43 .Sh DESCRIPTION
44 The
45 .Nm
46 utility is used to speed up the distribution of very large NIS maps
47 from NIS master to NIS slave servers.
48 The normal method for transferring
49 maps involves several steps:
50 .Bl -bullet -offset indent
51 .It
52 The master server calls
53 .Xr yppush 8
54 to inform the slave servers to start a transfer.
55 .It
56 The slave servers invoke
57 .Xr ypxfr 8 ,
58 which reads the entire contents of a map from the master server
59 using the
60 .Fn yp_all
61 function.
62 .It
63 The
64 .Xr ypxfr 8
65 program then creates a new map database file by using the
66 .Xr db 3
67 library hash method to store the data that it receives from the server.
68 .It
69 When all the data has been retrieved,
70 .Xr ypxfr 8
71 moves the new file into place and sends
72 .Xr ypserv 8
73 on the local machine a YPPROC_CLEAR to tell it to refresh its
74 database handles.
75 .El
76 .Pp
77 This process can take several minutes when there are very large
78 maps involved.
79 For example: a passwd database with several tens of
80 thousands of entries can consume several megabytes of disk space,
81 and it can take the
82 .Xr db 3
83 library package a long time to sort and store all the records
84 in a hash database.
85 Consider also that there are two sets of map
86 files:
87 .Pa master.passwd.by{name,uid}
88 and
89 .Pa passwd.by{name,uid} .
90 .Pp
91 The
92 .Nm
93 utility speeds up the transfer process by allowing NIS slave servers to
94 simply copy the master server's map files rather than building their
95 own from scratch.
96 Simply put,
97 .Nm
98 implements an RPC-based file transfer protocol.
99 Transferring even
100 a multi-megabyte file in this fashion takes only a few seconds compared
101 to the several minutes it would take even a reasonably fast slave server
102 to build a new map from scratch.
103 .Pp
104 The
105 .Nm
106 utility uses the same access restriction mechanism as
107 .Xr ypserv 8 .
108 This means that slave servers will only be permitted to transfer
109 files if the rules in the
110 .Pa securenets
111 database permit it (see
112 .Xr ypserv 8
113 for more information on
114 .Pa securenets ) .
115 Furthermore, only slave servers using reserved
116 ports will be allowed to transfer the
117 .Pa master.passwd
118 maps.
119 .Sh OPTIONS
120 The following option is available:
121 .Bl -tag -width indent
122 .It Fl p Ar path
123 This option can be used to override the default path to
124 the location of the NIS
125 map databases.
126 The compiled-in default path is
127 .Pa /var/yp .
128 .El
129 .Sh FILES
130 .Bl -tag -width Pa -compact
131 .It Pa /var/yp/[domainname]/[maps]
132 The NIS maps for a particular NIS domain.
133 .El
134 .Sh SEE ALSO
135 .Xr yp 8 ,
136 .Xr yppush 8 ,
137 .Xr ypserv 8 ,
138 .Xr ypxfr 8
139 .Sh AUTHORS
140 .An Bill Paul Aq wpaul@ctr.columbia.edu
141 .Sh BUGS
142 The
143 .Dx
144 .Nm ypxfrd
145 protocol is not compatible with that used by SunOS.
146 This is unfortunate
147 but unavoidable: Sun's protocol is not freely available, and even if it
148 were it would probably not be useful since the SunOS NIS v2 implementation
149 uses the original ndbm package for its map databases whereas the
150 .Dx
151 implementation uses Berkeley DB.
152 These two packages use vastly different
153 file formats.
154 Furthermore, ndbm is byte-order sensitive and not very
155 smart about it, meaning that am ndbm database created on a big endian
156 system can't be read on a little endian system.