summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-24 21:39:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-24 21:39:29 +0000
commita2b49066d001c8c07c847e67ac3f2bf521fdc1dc (patch)
tree287b57d8eda0ca39cea290ac0ec92c7b8f94adce
parentd75a6262c9d4b16c12eec1d91f48d682bd42a75d (diff)
spell my name correctly, use yp.h instead of yp_prot.h
-rw-r--r--usr.sbin/ypset/ypset.84
-rw-r--r--usr.sbin/ypset/ypset.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/ypset/ypset.8 b/usr.sbin/ypset/ypset.8
index 4d57cf08793..09c0c231ec8 100644
--- a/usr.sbin/ypset/ypset.8
+++ b/usr.sbin/ypset/ypset.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ypset.8,v 1.2 1996/03/25 15:56:23 niklas Exp $
+.\" $OpenBSD: ypset.8,v 1.3 1996/04/24 21:39:27 deraadt Exp $
.\" $NetBSD: ypset.8,v 1.2 1996/02/28 01:25:08 thorpej Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -88,4 +88,4 @@ instead of the default domain as returned by
.Xr ypwhich 1 ,
.Xr yp 8
.Sh AUTHOR
-Theo De Raadt
+Theo de Raadt
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c
index 0f13ec4d02d..98620c7d0d9 100644
--- a/usr.sbin/ypset/ypset.c
+++ b/usr.sbin/ypset/ypset.c
@@ -41,7 +41,7 @@ static char rcsid[] = "ypset.c,v 1.3 1993/06/12 00:02:37 deraadt Exp";
#include <netdb.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
-#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
#include <arpa/inet.h>
@@ -64,6 +64,7 @@ char *dom, *server;
CLIENT *client;
int sock, port;
int r;
+ struct in_addr iaddr;
if( (port=htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0) {
fprintf(stderr, "%s not running ypserv.\n", server);
@@ -72,17 +73,19 @@ char *dom, *server;
bzero(&ypsd, sizeof ypsd);
- if (inet_aton(server, &ypsd.ypsetdom_addr) == 0) {
+ if (inet_aton(server, &iaddr) == 0) {
hp = gethostbyname(server);
if (hp == NULL) {
fprintf(stderr, "ypset: can't find address for %s\n", server);
exit(1);
}
- bcopy(hp->h_addr, &ypsd.ypsetdom_addr, sizeof(ypsd.ypsetdom_addr));
+ bcopy(hp->h_addr, &iaddr, sizeof(iaddr));
}
-
- strncpy(ypsd.ypsetdom_domain, dom, sizeof ypsd.ypsetdom_domain);
- ypsd.ypsetdom_port = port;
+ ypsd.ypsetdom_domain = dom;
+ bcopy(&iaddr, &ypsd.ypsetdom_binding.ypbind_binding_addr,
+ sizeof(ypsd.ypsetdom_binding.ypbind_binding_addr));
+ bcopy(&port, &ypsd.ypsetdom_binding.ypbind_binding_port,
+ sizeof(ypsd.ypsetdom_binding.ypbind_binding_port));
ypsd.ypsetdom_vers = YPVERS;
tv.tv_sec = 15;