summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-12 00:14:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-12 00:14:29 +0000
commit3e69f20c4cb350dfe7f8611b5a6ff069cf3e6b5c (patch)
tree6b9d9a53515ca12561846eb0d6b753c962dec346
parentac808dd0020d95a1ebcd4bcd3bb1f84d25692808 (diff)
-1 flag enables v1 YP, otherwise it is disabled; from maja
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv.85
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv.c26
2 files changed, 21 insertions, 10 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv.8 b/usr.sbin/ypserv/ypserv/ypserv.8
index 559cb64ae6a..5a2af84386f 100644
--- a/usr.sbin/ypserv/ypserv/ypserv.8
+++ b/usr.sbin/ypserv/ypserv/ypserv.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ypserv.8,v 1.7 1996/12/07 12:18:40 deraadt Exp $
+.\" $OpenBSD: ypserv.8,v 1.8 1997/04/12 00:14:28 deraadt Exp $
.\" Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
.\" All rights reserved.
.\"
@@ -36,6 +36,7 @@
.Nd YP server daemon
.Sh SYNOPSIS
.Nm ypserv
+.Op Fl 1
.Op Fl a Ar aclfile
.Op Fl d
.Op Fl x
@@ -85,6 +86,8 @@ exists then messages will be written to the file.
.Pp
The options are as follows:
.Bl -tag -width indent
+.It Fl 1
+Allow ypserv to answer old YP version 1 requests.
.It Fl a Ar aclfile
Don't use
.Ar /var/yp/securenet .
diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c
index e6fbca7de1a..d253346ac79 100644
--- a/usr.sbin/ypserv/ypserv/ypserv.c
+++ b/usr.sbin/ypserv/ypserv/ypserv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv.c,v 1.8 1997/03/30 20:51:20 maja Exp $ */
+/* $OpenBSD: ypserv.c,v 1.9 1997/04/12 00:14:28 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypserv.c,v 1.8 1997/03/30 20:51:20 maja Exp $";
+static char rcsid[] = "$OpenBSD: ypserv.c,v 1.9 1997/04/12 00:14:28 deraadt Exp $";
#endif
#include "yp.h"
@@ -347,11 +347,15 @@ char *argv[];
int asize = sizeof (saddr);
int usage = 0;
int xflag = 0;
+ int allowv1 = 0;
int ch;
extern char *optarg;
- while ((ch = getopt(argc, argv, "a:dx")) != -1)
+ while ((ch = getopt(argc, argv, "1a:dx")) != -1)
switch (ch) {
+ case '1':
+ allowv1 = TRUE;
+ break;
case 'a':
aclfile = optarg;
break;
@@ -449,9 +453,11 @@ char *argv[];
}
if (!_rpcpmstart)
proto = IPPROTO_UDP;
- if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) {
- _msgout("unable to register (YPPROG, YPOLDVERS, udp).");
- exit(1);
+ if (allowv1) {
+ if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) {
+ _msgout("unable to register (YPPROG, YPOLDVERS, udp).");
+ exit(1);
+ }
}
if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) {
_msgout("unable to register (YPPROG, YPVERS, udp).");
@@ -470,9 +476,11 @@ char *argv[];
}
if (!_rpcpmstart)
proto = IPPROTO_TCP;
- if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) {
- _msgout("unable to register (YPPROG, YPOLDVERS, tcp).");
- exit(1);
+ if (allowv1) {
+ if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) {
+ _msgout("unable to register (YPPROG, YPOLDVERS, tcp).");
+ exit(1);
+ }
}
if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) {
_msgout("unable to register (YPPROG, YPVERS, tcp).");