summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.ypxfrd
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-13 11:22:39 +0000
committercharnier <charnier@FreeBSD.org>1997-10-13 11:22:39 +0000
commit8459f389a168bc4c5109f83e755a73813f58b8bb (patch)
tree34d312378554ef5de4d8763fd35100eb424ff996 /usr.sbin/rpc.ypxfrd
parent67de6ed0a2d20541b0f95abf9e5e36e1b8d32de4 (diff)
downloadFreeBSD-src-8459f389a168bc4c5109f83e755a73813f58b8bb.zip
FreeBSD-src-8459f389a168bc4c5109f83e755a73813f58b8bb.tar.gz
Use err(3). Remove multiply defined Id string.
Diffstat (limited to 'usr.sbin/rpc.ypxfrd')
-rw-r--r--usr.sbin/rpc.ypxfrd/rpc.ypxfrd.823
-rw-r--r--usr.sbin/rpc.ypxfrd/ypxfrd_main.c29
-rw-r--r--usr.sbin/rpc.ypxfrd/ypxfrd_server.c8
3 files changed, 31 insertions, 29 deletions
diff --git a/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8 b/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
index cba9879..5a403cc 100644
--- a/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
+++ b/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id$
+.\" $Id: rpc.ypxfrd.8,v 1.5 1997/02/22 16:13:01 peter Exp $
.\"
.Dd June 2, 1996
.Dt RPC.YPXFRD 8
@@ -41,7 +41,7 @@
.Op Fl p Ar path
.Sh DESCRIPTION
The
-.Nm rpc.ypxfrd
+.Nm
daemon is used to speed up the distribtion of very large NIS maps
from NIS master to NIS slave servers. The normal method for transfering
maps involves several steps:
@@ -83,18 +83,18 @@ and
.Pa passwd.by{name,uid} .
.Pp
The
-.Nm rpc.ypxfrd
+.Nm
server speeds up the transfer process by allowing NIS slave servers to
simply copy the master server's map files rather than building their
own from scratch. Simply put,
-.Nm rpc.ypxfrd
+.Nm
implements an RPC-based file transfer protocol. Transfering even
a multi-megabyte file in this fashion takes only a few seconds compared
to the several minutes it would take even a reasonably fast slave server
to build a new map from scratch.
.Pp
The
-.Nm rpc.ypxfrd
+.Nm
server uses the same access restriction mechanism as
.Xr ypserv 8 .
This means that slave servers will only be permitted to transfer
@@ -105,9 +105,8 @@ ports will be allowed to transfer the
.Pa master.passwd
maps.
.Sh OPTIONS
-The following options and flags are supported by
-.Nm rpc.ypxfrd :
-.Bl -tag -width flag
+The following option is available:
+.Bl -tag -width indent
.It Fl p Ar path
This option can be used to override the default path to
the location of the NIS
@@ -125,15 +124,17 @@ The NIS maps for a particular NIS domain.
.Xr ypserv 8 ,
.Xr ypxfr 8
.Sh BUGS
-The FreeBSD
+The
+.Bx Free
.Nm ypxfrd
protocol is not compatible with that used by SunOS. This is unfortunate
but unavoidable: Sun's protocol is not freely available, and even if it
were it would probably not be useful since the SunOS NIS v2 implementation
-uses the original ndbm package for its map databases whereas the FreeBSD
+uses the original ndbm package for its map databases whereas the
+.Bx Free
implementation uses Berkeley DB. These two packages use vastly different
file formats. Furthermore, ndbm is byte-order sensitive and not very
smart about it, meaning that am ndbm database created on a big endian
system can't be read on a little endian system.
.Sh AUTHOR
-Bill Paul <wpaul@ctr.columbia.edu>
+.An Bill Paul Aq wpaul@ctr.columbia.edu
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
index 126f338..5168409 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
@@ -28,11 +28,16 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: ypxfrd_main.c,v 1.4 1997/03/11 15:56:48 peter Exp $
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include "ypxfrd.h"
+#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h> /* getenv, exit */
#include <unistd.h>
@@ -60,9 +65,6 @@
#endif
#define _RPCSVC_CLOSEDOWN 120
-#ifndef lint
-static const char rcsid[] = "$Id: ypxfrd_main.c,v 1.4 1997/03/11 15:56:48 peter Exp $";
-#endif /* not lint */
int _rpcpmstart; /* Started by a port monitor ? */
static int _rpcfdtype;
/* Whether Stream or Datagram ? */
@@ -84,7 +86,7 @@ void _msgout(char* msg)
if (_rpcpmstart)
syslog(LOG_ERR, msg);
else
- (void) fprintf(stderr, "%s\n", msg);
+ warnx("%s", msg);
#else
syslog(LOG_ERR, msg);
#endif
@@ -144,7 +146,7 @@ ypxfrd_svc_run()
if (errno == EINTR) {
continue;
}
- perror("svc_run: - select failed");
+ warn("svc_run: - select failed");
return;
case 0:
continue;
@@ -177,17 +179,18 @@ static void reaper(sig)
void usage()
{
- fprintf(stderr, "%s [-p path]\n", progname);
+ fprintf(stderr, "usage: rpc.ypxfrd [-p path]\n");
exit(0);
}
+int
main(argc, argv)
int argc;
char *argv[];
{
- register SVCXPRT *transp;
+ register SVCXPRT *transp = NULL;
int sock;
- int proto;
+ int proto = 0;
struct sockaddr_in saddr;
int asize = sizeof (saddr);
int ch;
@@ -223,10 +226,8 @@ main(argc, argv)
int pid, i;
pid = fork();
- if (pid < 0) {
- perror("cannot fork");
- exit(1);
- }
+ if (pid < 0)
+ err(1, "fork");
if (pid)
exit(0);
size = getdtablesize();
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
index fd98615..a8fe278 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
@@ -28,15 +28,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: ypxfrd_server.c,v 1.5 1997/04/10 13:48:59 wpaul Exp $
*/
-#include "ypxfrd.h"
#ifndef lint
-static const char rcsid[] = "$Id: ypxfrd_server.c,v 1.5 1997/04/10 13:48:59 wpaul Exp $";
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
+#include "ypxfrd.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
OpenPOWER on IntegriCloud