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/ypbind.c | |
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/ypbind.c')
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 */ |