diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-04-05 03:23:40 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-04-05 03:23:40 +0000 |
commit | 9ca32a6be53704fcf27194f3317d537de6e8c571 (patch) | |
tree | 643014d2f13464ccb9d4281f7d48bef0ca33bb71 /gnu | |
parent | 5b52649d42d62589349a210d4161909b27a49475 (diff) | |
download | FreeBSD-src-9ca32a6be53704fcf27194f3317d537de6e8c571.zip FreeBSD-src-9ca32a6be53704fcf27194f3317d537de6e8c571.tar.gz |
Added a new feature from Peter Eriksson's latest release of ypserv (0.13):
register ourselves as an NIS version 1 UDP server to pacify older SunOS 4
ypbinds that seem to insist on having one around. All this does is allow
ypserv to respond to DOMAIN_NONACK requests that are periodically
transmitted by ypbind: the server will not actually work as an NIS v1
server in any other way.
Unlike the mainline code, which implements this as a compile-time
option, this feature can be turned on with the newly-added -k flag
at runtime.
Bunped version number to 0.13. (What the hell.)
Updated the man page to reflect this change, also made a couple of small
edits to reflect the recent changes in the /etc/rc* setup.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.sbin/ypserv/yp_svc.c | 24 | ||||
-rw-r--r-- | gnu/usr.sbin/ypserv/ypserv.8 | 23 |
2 files changed, 40 insertions, 7 deletions
diff --git a/gnu/usr.sbin/ypserv/yp_svc.c b/gnu/usr.sbin/ypserv/yp_svc.c index fc525cd..ea5fe73 100644 --- a/gnu/usr.sbin/ypserv/yp_svc.c +++ b/gnu/usr.sbin/ypserv/yp_svc.c @@ -6,7 +6,7 @@ * And thus replied Lpd@NannyMUD: * Who cares? :-) /Peter Eriksson <pen@signum.se> * - * $Id$ + * $Id: yp_svc.c,v 1.1 1995/01/31 08:58:56 wpaul Exp $ */ #include "system.h" @@ -261,7 +261,7 @@ int main(int argc, char **argv) int my_socket; struct sockaddr_in socket_address; int result; - + int sunos_4_kludge = 0; progname = strrchr (argv[0], '/'); if (progname == (char *) NULL) @@ -279,6 +279,8 @@ int main(int argc, char **argv) dns_flag = 1; else if ((argv[i][1] == 'p') && (argv[i][2] >= '0') && (argv[i][2] <= '9')) my_port = atoi(argv[i] + 2); + else if (strcmp(argv[i], "-k") == 0) + sunos_4_kludge = 1; else { fprintf(stderr, "%s: Unknown command line switch: %s\n", @@ -296,7 +298,7 @@ int main(int argc, char **argv) } if (debug_flag) - Perror("[Welcome to the NYS YP Server, version 0.11]\n"); + Perror("[Welcome to the NYS YP Server, version 0.13]\n"); if (i < argc) { @@ -313,6 +315,8 @@ int main(int argc, char **argv) } (void) pmap_unset(YPPROG, YPVERS); + if (sunos_4_kludge) + (void) pmap_unset(YPPROG, 1); if (my_port >= 0) { @@ -350,6 +354,20 @@ int main(int argc, char **argv) exit(1); } + if (sunos_4_kludge) { + /* + ** This is just to make us reply to YP version 1 calls which SunOS 4's + ** ypbind seems to insist on finding. If someone _really_ tries to + ** use this the they will probably be bitten - _hard_, since I haven't + ** got the faintest idea on how the XDR calls for YP version 1 should + ** look like. The Domain_NoNack call seems to be compatible though :-) + */ + if (!svc_register(transp, YPPROG, 1, ypprog_2, IPPROTO_UDP)) { + fprintf(stderr, "unable to register (YPPROG, 1, udp)."); + exit(1); + } + } + if (my_port >= 0) { my_socket = socket (AF_INET, SOCK_STREAM, 0); diff --git a/gnu/usr.sbin/ypserv/ypserv.8 b/gnu/usr.sbin/ypserv/ypserv.8 index 209db1f..43ac853 100644 --- a/gnu/usr.sbin/ypserv/ypserv.8 +++ b/gnu/usr.sbin/ypserv/ypserv.8 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: ypserv.8,v 1.1 1995/02/04 21:32:04 wpaul Exp $ +.\" $Id: ypserv.8,v 1.2 1995/02/07 05:04:51 wpaul Exp $ .\" .Dd February 4, 1995 .Dt YPSERV 8 @@ -41,6 +41,7 @@ .Nm ypserv .Op Fl dns .Op Fl debug +.Op Fl k .Op Fl p Ar port .Sh DESCRIPTION .Nm NIS @@ -98,9 +99,9 @@ good general practice. .Pp .Nm ypserv is started by -.Nm /etc/rc.local +.Nm /etc/rc if it has been enabled in -.Nm /etc/netstart. +.Nm /etc/sysconfig. .Sh SPECIAL FEATURES There are some problems associated with distributing FreeBSD's password database via NIS: FreeBSD normally only stores encrypted passwords @@ -247,6 +248,20 @@ Run the server in debugging mode: the server does not background itself and prints copious debugging output to stderr for each request that it revceives. +.It Fl k +This flag is provided for compatibility with SunOS 4. The +.Xr ypbind 8 +command in SunOS 4 apparently expects to obtain a response from an +NIS v1 server. Starting +.Xr ypserv 8 +with the +.Fl k +flag causes it to register itself as an NIS v1 server and +respond to DOMAIN_NONACK requests. Note carefully: this is merely a +kludge (hence the 'k') to pacify SunOS 4's +.Xr ypbind 8 +command: attempts to make the server actually handle NIS v1 queries +will undoubtedly fail quite miserably. .It Fl p Ar port Normally, .Nm ypserv @@ -272,7 +287,7 @@ Resolver configuration file. .Sh LICENSE This program is covered by the GNU Public License version 2. .Sh AUTHOR -Peter Eriksson <pem@signum.se> (original Linux version) +Peter Eriksson <pem@signum.se> (original version) .br Bill Paul <wpaul@ctr.columbia.edu> (port to FreeBSD and various changes) |