From eab2cf5136f108d58c33659c1d6e61d369801ec7 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 24 Apr 1996 21:39:27 +0000 Subject: [PATCH] spell my name correctly, use yp.h instead of yp_prot.h --- usr.sbin/ypset/ypset.8 | 4 ++-- usr.sbin/ypset/ypset.c | 15 +++++++++------ 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 #include #include -#include +#include #include #include @@ -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; -- 2.20.1