diff options
author | bz <bz@FreeBSD.org> | 2004-11-13 20:40:32 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2004-11-13 20:40:32 +0000 |
commit | 4b83c5852a5bcba28ed7ce5d13ff021642859772 (patch) | |
tree | da33d2aed5fb6a0c2319fb0d10f0957f518eee99 /usr.sbin/bootparamd | |
parent | a67c7e75123103251e304a51ba19d0530b75981d (diff) | |
download | FreeBSD-src-4b83c5852a5bcba28ed7ce5d13ff021642859772.zip FreeBSD-src-4b83c5852a5bcba28ed7ce5d13ff021642859772.tar.gz |
Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on no NIS support and related programs will be built.
Lost parts rediscovered by: Danny Braniss <danny at cs.huji.ac.il>
PR: bin/68303
No objections: des, gshapiro, nectar
Reviewed by: ru
Approved by: rwatson (mentor)
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/bootparamd')
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/Makefile | 3 | ||||
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/bootparamd.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/usr.sbin/bootparamd/bootparamd/Makefile b/usr.sbin/bootparamd/bootparamd/Makefile index 11c6390..af8a0dc 100644 --- a/usr.sbin/bootparamd/bootparamd/Makefile +++ b/usr.sbin/bootparamd/bootparamd/Makefile @@ -7,6 +7,9 @@ SRCS= bootparamd.c main.c ${GENSRCS} GENSRCS=bootparam_prot.h bootparam_prot_svc.c bootparam_prot_xdr.c CFLAGS+= -DTFTP_DIR=\"/tftpboot\" -I. +.if !defined(NO_NIS) +CFLAGS+= -DYP +.endif CLEANFILES= ${GENSRCS} diff --git a/usr.sbin/bootparamd/bootparamd/bootparamd.c b/usr.sbin/bootparamd/bootparamd/bootparamd.c index 159124e..238686b 100644 --- a/usr.sbin/bootparamd/bootparamd/bootparamd.c +++ b/usr.sbin/bootparamd/bootparamd/bootparamd.c @@ -12,9 +12,11 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#ifdef YP #include <rpc/rpc.h> #include <rpcsvc/yp_prot.h> #include <rpcsvc/ypclnt.h> +#endif #include "bootparam_prot.h" #include <ctype.h> #include <err.h> @@ -191,7 +193,9 @@ int blen; char *where; static char *result; int resultlen; +#ifdef YP static char *yp_domain; +#endif int ch, pch, fid_len, res = 0; int match = 0; @@ -212,6 +216,7 @@ int blen; } } if (*hostname == '+' ) { /* NIS */ +#ifdef YP if (yp_get_default_domain(&yp_domain)) { if (debug) warn("NIS"); return(0); @@ -230,6 +235,9 @@ int blen; if (fclose(bpf)) warnx("could not close %s", bootpfile); return(1); +#else + return(0); /* ENOTSUP */ +#endif } /* skip to next entry */ if ( match ) break; @@ -288,7 +296,9 @@ int len; int res = 0; static char *result; int resultlen; +#ifdef YP static char *yp_domain; +#endif /* struct hostent *cmp_he;*/ @@ -315,6 +325,7 @@ int len; } } if (*hostname == '+' ) { /* NIS */ +#ifdef YP if (yp_get_default_domain(&yp_domain)) { if (debug) warn("NIS"); return(0); @@ -332,6 +343,9 @@ int len; if (fclose(bpf)) warnx("could not close %s", bootpfile); return(res); +#else + return(0); /* ENOTSUP */ +#endif } /* skip to next entry */ pch = ch = getc(bpf); |