diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-18 23:50:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-18 23:50:13 +0000 |
commit | cd800456f3efa62f7a8e43012d5e491ecc2928ae (patch) | |
tree | a439ad93019dec5731c8ef334da8ce27d4bcd615 /usr.sbin/ypbind | |
parent | c8708ed93617f5d278f4f7faf294a6e7c57227df (diff) |
add -insecure flag for binding to non-reserved ypservs; problem from pjt@bsd1.phxlab.allied.com; PR#232
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r-- | usr.sbin/ypbind/ypbind.8 | 11 | ||||
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 13 |
2 files changed, 16 insertions, 8 deletions
diff --git a/usr.sbin/ypbind/ypbind.8 b/usr.sbin/ypbind/ypbind.8 index f1fc667ba8e..97942932671 100644 --- a/usr.sbin/ypbind/ypbind.8 +++ b/usr.sbin/ypbind/ypbind.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ypbind.8,v 1.7 1997/04/02 18:05:47 deraadt Exp $ +.\" $OpenBSD: ypbind.8,v 1.8 1997/06/18 23:50:12 deraadt Exp $ .\" $NetBSD: ypbind.8,v 1.2 1996/02/28 01:21:00 thorpej Exp $ .\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -44,8 +44,8 @@ .Sh SYNOPSIS .Nm .Op Fl ypset -.Nm .Op Fl ypsetme +.Op Fl insecure .Sh DESCRIPTION .Nm finds the server for a particular YP domain and stores information about it @@ -85,7 +85,7 @@ When the binding is once again successful, marks the domain as bound and resumes its periodic check. .Pp The options are as follows: -.Bl -tag -width indent +.Bl -tag -width indentxx .It Fl ypset .Xr ypset 8 may be used to change the server to which a domain is bound. @@ -93,6 +93,11 @@ may be used to change the server to which a domain is bound. .Xr ypset 8 may be used only from this machine to change the server to which a domain is bound. +.It Fl insecure +permit binding to a +.Xr ypserv 8 +on a non-reserved port. This is needed if receiving maps from +SunOS 3.x or Ultrix. .El .Pp The diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 8e540a6aeb6..1d1d8bdb723 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypbind.c,v 1.28 1997/06/14 07:12:14 deraadt Exp $ */ +/* $OpenBSD: ypbind.c,v 1.29 1997/06/18 23:50:12 deraadt Exp $ */ /* * Copyright (c) 1996 Theo de Raadt <deraadt@theos.com> @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypbind.c,v 1.28 1997/06/14 07:12:14 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ypbind.c,v 1.29 1997/06/18 23:50:12 deraadt Exp $"; #endif #include <sys/param.h> @@ -110,6 +110,7 @@ int check; #define YPSET_LOCAL 1 #define YPSET_ALL 2 int ypsetmode = YPSET_NO; +int insecure = 0; int rpcsock, pingsock; struct rmtcallargs rmtca; @@ -342,7 +343,7 @@ ypbindprog_2(rqstp, transp) void usage() { - fprintf(stderr, "usage: ypbind [-ypset] [-ypsetme]\n"); + fprintf(stderr, "usage: ypbind [-ypset] [-ypsetme] [-insecure]\n"); exit(0); } @@ -368,7 +369,9 @@ main(argc, argv) while (--argc) { ++argv; - if (!strcmp("-ypset", *argv)) + if (!strcmp("-insecure", *argv)) + insecure = 1; + else if (!strcmp("-ypset", *argv)) ypsetmode = YPSET_ALL; else if (!strcmp("-ypsetme", *argv)) ypsetmode = YPSET_LOCAL; @@ -1027,7 +1030,7 @@ int force; } /* we do not support sunos 3.0 insecure servers */ - if (ntohs(raddrp->sin_port) >= IPPORT_RESERVED) + if (insecure == 0 && ntohs(raddrp->sin_port) >= IPPORT_RESERVED) return; /* soft update, alive */ |