1665823d0SBill Paul.\" Copyright (c) 1995 2665823d0SBill Paul.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 3665823d0SBill Paul.\" 4665823d0SBill Paul.\" Redistribution and use in source and binary forms, with or without 5665823d0SBill Paul.\" modification, are permitted provided that the following conditions 6665823d0SBill Paul.\" are met: 7665823d0SBill Paul.\" 1. Redistributions of source code must retain the above copyright 8665823d0SBill Paul.\" notice, this list of conditions and the following disclaimer. 9665823d0SBill Paul.\" 2. Redistributions in binary form must reproduce the above copyright 10665823d0SBill Paul.\" notice, this list of conditions and the following disclaimer in the 11665823d0SBill Paul.\" documentation and/or other materials provided with the distribution. 12665823d0SBill Paul.\" 3. All advertising materials mentioning features or use of this software 13665823d0SBill Paul.\" must display the following acknowledgement: 14665823d0SBill Paul.\" This product includes software developed by Bill Paul. 15665823d0SBill Paul.\" 4. Neither the name of the University nor the names of its contributors 16665823d0SBill Paul.\" may be used to endorse or promote products derived from this software 17665823d0SBill Paul.\" without specific prior written permission. 18665823d0SBill Paul.\" 19665823d0SBill Paul.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 20665823d0SBill Paul.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21665823d0SBill Paul.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22665823d0SBill Paul.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 23665823d0SBill Paul.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24665823d0SBill Paul.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25665823d0SBill Paul.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26665823d0SBill Paul.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27665823d0SBill Paul.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28665823d0SBill Paul.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29665823d0SBill Paul.\" SUCH DAMAGE. 30665823d0SBill Paul.\" 31665823d0SBill Paul.Dd February 5, 1995 32665823d0SBill Paul.Dt YPXFR 8 33665823d0SBill Paul.Os 34665823d0SBill Paul.Sh NAME 35665823d0SBill Paul.Nm ypxfr 36665823d0SBill Paul.Nd "transfer NIS database from remote server to local host" 37665823d0SBill Paul.Sh SYNOPSIS 3827eed7e3SPhilippe Charnier.Nm /usr/libexec/ypxfr 39665823d0SBill Paul.Op Fl f 40665823d0SBill Paul.Op Fl c 41665823d0SBill Paul.Op Fl d Ar target domain 42665823d0SBill Paul.Op Fl h Ar source host 43665823d0SBill Paul.Op Fl s Ar source domain 44665823d0SBill Paul.Op Fl p Ar path 45665823d0SBill Paul.Op Fl C Ar taskid program-number ipaddr port 46665823d0SBill Paul.Ar mapname 47665823d0SBill Paul.Sh DESCRIPTION 483f162cb8SPhilippe CharnierThe 493f162cb8SPhilippe Charnier.Nm 503f162cb8SPhilippe Charnierutility copies an 5127eed7e3SPhilippe Charnier.Tn NIS 5227eed7e3SPhilippe Charnierdatabase (or 53665823d0SBill Paul.Pa map ) 5427eed7e3SPhilippe Charnierfrom one 5527eed7e3SPhilippe Charnier.Tn NIS 5627eed7e3SPhilippe Charnierserver to another using 5727eed7e3SPhilippe Charnier.Tn NIS 58c481aa05SRuslan Ermilovservices. 59c481aa05SRuslan ErmilovIn 60bb2c7cbbSMike Pritchard.Fx , 6127eed7e3SPhilippe Charnier.Nm 62665823d0SBill Paulis generally invoked by 63665823d0SBill Paul.Xr ypserv 8 64665823d0SBill Paulwhen it receives a map transfer request from 65665823d0SBill Paul.Xr yppush 8 . 663f162cb8SPhilippe CharnierThe 673f162cb8SPhilippe Charnier.Nm 683f162cb8SPhilippe Charnierutility is used primarily in environments where several 6927eed7e3SPhilippe Charnier.Tn NIS 70c481aa05SRuslan Ermilovservers are in use in a single domain. 71c481aa05SRuslan ErmilovOne server, the 7227eed7e3SPhilippe Charnier.Tn NIS 7327eed7e3SPhilippe Charniermaster, maintains 7427eed7e3SPhilippe Charnierthe canonical copies of all 7527eed7e3SPhilippe Charnier.Tn NIS 7627eed7e3SPhilippe Charniermaps, and all the other servers, 7727eed7e3SPhilippe Charnierthe 7827eed7e3SPhilippe Charnier.Tn NIS 7927eed7e3SPhilippe Charnierslaves, copy new versions of the maps from the master whenever 80c481aa05SRuslan Ermilovany updates are made (i.e., when a user updates their password via 8127eed7e3SPhilippe Charnier.Xr yppasswd 1 ) . 82665823d0SBill Paul.Pp 83665823d0SBill PaulWhen run, 8427eed7e3SPhilippe Charnier.Nm 85665823d0SBill Paulcreates a temporary database file in 862d6804f6SJoel Dahl.Pa /var/yp/[domainname] , 87665823d0SBill Pauland fills it with the contents of 88665823d0SBill Paul.Ar mapname 89665823d0SBill Paulas supplied by the specified 90665823d0SBill Paul.Ar source host . 91f6ac2391SJoel DahlWhen the entire map has been transferred, 9227eed7e3SPhilippe Charnier.Nm 93665823d0SBill Pauldeletes the original copy of 94665823d0SBill Paul.Ar mapname 95c481aa05SRuslan Ermilovand moves the temporary copy into its place. 96c481aa05SRuslan ErmilovWhen the transfer is 97665823d0SBill Paulcomplete, 9827eed7e3SPhilippe Charnier.Nm 99665823d0SBill Paulwill attempt to send a 'clear current map' request to the local 100665823d0SBill Paul.Xr ypserv 8 101665823d0SBill Paulprocess to clear any possible references it may still have to the 102665823d0SBill Paulstale map. 103665823d0SBill Paul.Pp 104665823d0SBill PaulNote that all files created by 10527eed7e3SPhilippe Charnier.Nm 106c481aa05SRuslan Ermilovare owner readable and writable only for security reasons. 107c481aa05SRuslan ErmilovSince the 10827eed7e3SPhilippe Charnier.Tn NIS 10927eed7e3SPhilippe Charniermaps and the directory in which they reside are normally owned by 11057bd0fc6SJens Schweikhardtroot, this prevents non-privileged users from making unauthorized 111665823d0SBill Paulmodifications. 112665823d0SBill Paul.Pp 11327eed7e3SPhilippe CharnierIn order to maintain consistency across all 11427eed7e3SPhilippe Charnier.Tn NIS 11527eed7e3SPhilippe Charnierservers, 11627eed7e3SPhilippe Charnier.Nm 117665823d0SBill Paulcan be run periodically in a 118665823d0SBill Paul.Xr cron 8 119c481aa05SRuslan Ermilovjob. 120c481aa05SRuslan ErmilovMaps which change infrequently 121665823d0SBill Paulneed only be updated once a day (preferably late at night when system 122665823d0SBill Paulusage is lowest), whereas those that are subject to frequent changes 123665823d0SBill Paul(such a 124665823d0SBill Paul.Pa passwd.byname 125665823d0SBill Pauland 126665823d0SBill Paul.Pa passwd.byuid ) 127c481aa05SRuslan Ermilovshould be updated perhaps once every hour. 128c481aa05SRuslan ErmilovUsing 129665823d0SBill Paul.Xr cron 8 130665823d0SBill Paulto automatically 13127eed7e3SPhilippe Charnierupdate the 13227eed7e3SPhilippe Charnier.Tn NIS 13327eed7e3SPhilippe Charniermaps is not strictly mandatory since all updates should 134665823d0SBill Paulbe propagated by 135665823d0SBill Paul.Xr yppush 8 136665823d0SBill Paulwhen 137665823d0SBill Paul.Pa /var/yp/Makefile 13827eed7e3SPhilippe Charnieris run on the 13927eed7e3SPhilippe Charnier.Tn NIS 14027eed7e3SPhilippe Charniermaster server, however it is good practice 14127eed7e3SPhilippe Charnieron large networks where possible outages could cause 14227eed7e3SPhilippe Charnier.Tn NIS 14327eed7e3SPhilippe Charnierservers to fall out of sync with each other. 144665823d0SBill Paul.Pp 145665823d0SBill PaulWhen 14627eed7e3SPhilippe Charnier.Nm 147c481aa05SRuslan Ermilovis invoked without a controlling terminal, e.g.\& from inside 148665823d0SBill Paul.Xr ypserv 8 , 149665823d0SBill Paulit logs all its output using the 150665823d0SBill Paul.Xr syslog 3 151665823d0SBill Paulfacility. 15216deb43aSBill Paul.Sh NOTES 15327eed7e3SPhilippe CharnierThe 154bb2c7cbbSMike Pritchard.Fx 15527eed7e3SPhilippe Charnierversion of 15627eed7e3SPhilippe Charnier.Nm 15716deb43aSBill Paulhas support for a special map transfer protocol which works in 15827eed7e3SPhilippe Charnierconjunction with the 159bb2c7cbbSMike Pritchard.Fx 16016deb43aSBill Paul.Xr rpc.ypxfrd 8 161c481aa05SRuslan Ermilovserver. 162c481aa05SRuslan ErmilovThis protocol allows it to transfer raw map database files from 16327eed7e3SPhilippe Charnierthe 16427eed7e3SPhilippe Charnier.Tn NIS 16527eed7e3SPhilippe Charniermaster server and can be many times faster than the standard 16627eed7e3SPhilippe Charniertransfer method, particularly for very large 16727eed7e3SPhilippe Charnier.Tn NIS 168c481aa05SRuslan Ermilovmaps. 169c481aa05SRuslan ErmilovThe 17027eed7e3SPhilippe Charnier.Nm 1713f162cb8SPhilippe Charnierutility will check to see if the 17216deb43aSBill Paul.Xr rpc.ypxfrd 8 17327eed7e3SPhilippe Charnierserver is registered on the 17427eed7e3SPhilippe Charnier.Tn NIS 17527eed7e3SPhilippe Charniermaster server and attempt to use 176c481aa05SRuslan Ermilovit if it is present. 1770227791bSRuslan ErmilovIf it is not it will fall back to the standard 17816deb43aSBill Paultransfer method, copying the map contents from 17916deb43aSBill Paul.Xr ypserv 8 18016deb43aSBill Pauland creating new maps instead. 18116deb43aSBill Paul.Pp 18227eed7e3SPhilippe CharnierNote that while the 183bb2c7cbbSMike Pritchard.Fx 18427eed7e3SPhilippe Charnierypxfrd protocol is conceptually similar 18527eed7e3SPhilippe Charnierto the SunOS ypxfrd protocol, 186bb2c7cbbSMike Pritchardthe 187bb2c7cbbSMike Pritchard.Fx 18827eed7e3SPhilippe Charnierprotocol is not compatible with 18927eed7e3SPhilippe CharnierSun's, therefore it will not work with Sun's ypxfrd server. 190bb2c7cbbSMike Pritchard.Fx 19127eed7e3SPhilippe Charnierslave systems can still transfer maps from any 192b5c508fbSRuslan Ermilov.No non- Ns Fx 19327eed7e3SPhilippe Charnier.Tn NIS 19427eed7e3SPhilippe Charnierserver, 19516deb43aSBill Paulhowever they will only be able to take advantage of the faster protocol 19627eed7e3SPhilippe Charnierif the master server is also running 197bb2c7cbbSMike Pritchard.Fx . 198665823d0SBill Paul.Sh OPTIONS 199665823d0SBill PaulThe following options and flags are supported by 20076081989SRuslan Ermilov.Nm : 20127eed7e3SPhilippe Charnier.Bl -tag -width indent 202665823d0SBill Paul.It Fl f 203c481aa05SRuslan ErmilovForce a map transfer. 204c481aa05SRuslan ErmilovNormally, 20527eed7e3SPhilippe Charnier.Nm 20627eed7e3SPhilippe Charnierwill not transfer a map if it determines that the 20727eed7e3SPhilippe Charnier.Tn NIS 20827eed7e3SPhilippe Charniermaster's copy 209665823d0SBill Paulis not newer than the existing copy already on the local host: the 210665823d0SBill Paul.Fl f 211665823d0SBill Paulflag forces a transfer regardless of which server's version is more recent. 212665823d0SBill Paul.It Fl c 213665823d0SBill PaulDo not send a 'clear current map' request to the 214665823d0SBill Paul.Xr ypserv 8 215c481aa05SRuslan Ermilovprocess running on the local host. 216c481aa05SRuslan ErmilovThis flag is normally used when 217665823d0SBill Paulinvoking 21827eed7e3SPhilippe Charnier.Nm 219665823d0SBill Paulmanually on a machine that is not yet running 220665823d0SBill Paul.Xr ypserv 8 . 22127eed7e3SPhilippe CharnierWithout this flag, failure to contact the local 22227eed7e3SPhilippe Charnier.Tn NIS 22327eed7e3SPhilippe Charnierserver will cause 22427eed7e3SPhilippe Charnier.Nm 225665823d0SBill Paulto abort the transfer. 226665823d0SBill Paul.It Fl d Ar target domain 22727eed7e3SPhilippe CharnierSpecify a target domain other than the current 22827eed7e3SPhilippe Charnier.Tn NIS 22927eed7e3SPhilippe Charnierdomain. 230665823d0SBill Paul.It Fl h Ar source host 23127eed7e3SPhilippe CharnierSpecify the name of the host from which to copy the 23227eed7e3SPhilippe Charnier.Tn NIS 233c481aa05SRuslan Ermilovmaps. 234c481aa05SRuslan ErmilovThis option 235e7f8dd75SRebecca Cranis used to ensure that 23627eed7e3SPhilippe Charnier.Nm 23727eed7e3SPhilippe Charnieronly copies maps from the 23827eed7e3SPhilippe Charnier.Tn NIS 23927eed7e3SPhilippe Charniermaster server. 240665823d0SBill Paul.It Fl s Ar source domain 241665823d0SBill PaulSpecify the domain from which to transfer a map, in the event that 24227eed7e3SPhilippe Charnierthe transfer is being done across two different 24327eed7e3SPhilippe Charnier.Tn NIS 24427eed7e3SPhilippe Charnierdomains. 245665823d0SBill Paul.It Fl p Ar path 24627eed7e3SPhilippe CharnierSpecify the top level directory containing the 24727eed7e3SPhilippe Charnier.Tn NIS 248c481aa05SRuslan Ermilovmaps. 249c481aa05SRuslan ErmilovBy 250665823d0SBill Pauldefault, this path is 251665823d0SBill Paul.Pa /var/yp . 252665823d0SBill PaulThe 253665823d0SBill Paul.Fl p 254665823d0SBill Paulflag allows you to specify an alternate path should you wish to 25527eed7e3SPhilippe Charnierstore your 25627eed7e3SPhilippe Charnier.Tn NIS 257c481aa05SRuslan Ermilovmaps in a different part of the file system. 258c481aa05SRuslan ErmilovThe 25927eed7e3SPhilippe Charnier.Tn NIS 26027eed7e3SPhilippe Charnierserver, 261665823d0SBill Paul.Xr ypserv 8 , 262665823d0SBill Paulpasses this flag to 26327eed7e3SPhilippe Charnier.Nm 264665823d0SBill Paulif it too has been told to use an alternate path. 265665823d0SBill Paul.It Fl C Ar taskid program-number ipaddr port 266665823d0SBill PaulThese options are used only when 26727eed7e3SPhilippe Charnier.Nm 268665823d0SBill Paulis invoked by 269665823d0SBill Paul.Xr ypserv 8 270665823d0SBill Paulin response to a map transfer request initiated by 271665823d0SBill Paul.Xr yppush 8 . 272665823d0SBill PaulIn this instance, 27327eed7e3SPhilippe Charnier.Nm 274665823d0SBill Paulneeds to 'callback' to the 275665823d0SBill Paul.Xr yppush 8 276665823d0SBill Paulprocess and interact with it, so 277665823d0SBill Paul.Xr yppush 8 278665823d0SBill Paulpasses to it an IP address 279665823d0SBill Paul.Ar ipaddr , 280665823d0SBill Paulport number 281665823d0SBill Paul.Ar port , 282665823d0SBill Paulregistered program number 283665823d0SBill Paul.Ar program-number 284665823d0SBill Pauland a transaction ID 285665823d0SBill Paul.Ar taskid 286665823d0SBill Paulthat it can use to contact the waiting 287665823d0SBill Paul.Xr yppush 8 288665823d0SBill Paulprocess on the master server. 289665823d0SBill Paul.It Ar mapname 290665823d0SBill PaulThe name of the map to transfer. 291665823d0SBill Paul.El 292665823d0SBill Paul.Sh FILES 293665823d0SBill Paul.Bl -tag -width Pa -compact 294665823d0SBill Paul.It Pa /var/yp/[domainname]/[maps] 29527eed7e3SPhilippe CharnierThe 29627eed7e3SPhilippe Charnier.Tn NIS 29727eed7e3SPhilippe Charniermaps for a particular 29827eed7e3SPhilippe Charnier.Tn NIS 29927eed7e3SPhilippe Charnierdomain. 300665823d0SBill Paul.El 301665823d0SBill Paul.Sh SEE ALSO 302491a8429SRuslan Ermilov.Xr yp 8 , 303af202156SWolfram Schneider.Xr yppush 8 , 304af202156SWolfram Schneider.Xr ypserv 8 30599e2b73dSPhilippe Charnier.Sh AUTHORS 306*01c2b8acSBaptiste Daroussin.An Bill Paul Aq Mt wpaul@ctr.columbia.edu 307