diff --git a/Makefile.inc1 b/Makefile.inc1 index 2ed9aaa6a942..8ee3dc32fddd 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -992,7 +992,7 @@ _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \ lib/libkvm lib/libmd \ lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ lib/libradius \ - lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \ + lib/libsbuf lib/libtacplus lib/libutil \ lib/libz lib/msun lib/libopie__L lib/libtacplus__L: lib/libmd__L @@ -1029,6 +1029,10 @@ _generic_libs+= secure/lib lib/libradius__L: lib/libmd__L .endif +.if !defined(NO_NIS) +_prebuild_libs+= lib/libypclnt +.endif + _generic_libs+= usr.bin/lex/lib .if ${MACHINE_ARCH} == "i386" diff --git a/lib/Makefile b/lib/Makefile index 18e0700379ce..4b763fa85b2d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -107,7 +107,7 @@ _libthread_db= libthread_db _libusbhid= libusbhid .endif -.if !defined(NO_YP_LIBC) +.if !defined(NO_NIS) _libypclnt= libypclnt .endif diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 95356b9af697..169a366642c5 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -60,7 +60,7 @@ NOASM= .if ${MACHINE_ARCH} == "arm" .include "${.CURDIR}/softfloat/Makefile.inc" .endif -.if !defined(NO_YP_LIBC) +.if !defined(NO_NIS) CFLAGS+= -DYP .include "${.CURDIR}/yp/Makefile.inc" .endif diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index 2431fd7629cb..04e2e882b515 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -202,7 +202,7 @@ setnetgrent(const char *group) return; } #else - if (netf = fopen(_PATH_NETGROUP, "r")) { + if ((netf = fopen(_PATH_NETGROUP, "r"))) { #endif if (parse_netgrp(group)) endnetgrent(); diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index fcdd639dfa80..1ad073d82871 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef YP #include +#ifdef YP #include #include #endif diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c index 3777e16ac293..1829a45f8b78 100644 --- a/lib/libc/rpc/netnamer.c +++ b/lib/libc/rpc/netnamer.c @@ -58,7 +58,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" static char *OPSYS = "unix"; +#ifdef YP static char *NETID = "netid.byname"; +#endif static char *NETIDFILE = "/etc/netid"; static int getnetid( char *, char * ); diff --git a/lib/libpam/modules/pam_unix/Makefile b/lib/libpam/modules/pam_unix/Makefile index f8501a78c64c..fde40feff5f4 100644 --- a/lib/libpam/modules/pam_unix/Makefile +++ b/lib/libpam/modules/pam_unix/Makefile @@ -38,9 +38,13 @@ LIB= pam_unix SRCS= pam_unix.c MAN= pam_unix.8 -CFLAGS+= -DYP +DPADD= ${LIBUTIL} ${LIBCRYPT} +LDADD= -lutil -lcrypt -DPADD= ${LIBUTIL} ${LIBCRYPT} ${LIBYPCLNT} -LDADD= -lutil -lcrypt -lypclnt +.if !defined(NO_NIS) +CFLAGS+= -DYP +DPADD+= ${LIBYPCLNT} +LDADD+= -lypclnt +.endif .include diff --git a/lib/librpcsvc/Makefile b/lib/librpcsvc/Makefile index c572249570e2..49a918b71127 100644 --- a/lib/librpcsvc/Makefile +++ b/lib/librpcsvc/Makefile @@ -9,9 +9,13 @@ RPCSRCS= klm_prot.x mount.x nfs_prot.x nlm_prot.x rex.x rnusers.x \ rquota.x rstat.x rwall.x sm_inter.x spray.x yppasswd.x ypxfrd.x \ ypupdate_prot.x -OTHERSRCS= rnusers.c rstat.c rwall.c yp_passwd.c yp_update.c +OTHERSRCS= rnusers.c rstat.c rwall.c SECRPCSRCS= secretkey.c xcrypt.c +.if !defined(NO_NIS) +OTHERSRCS+= yp_passwd.c yp_update.c +.endif + RPCCOM = rpcgen -C INCDIRS= -I${DESTDIR}/usr/include/rpcsvc diff --git a/lib/libwrap/Makefile b/lib/libwrap/Makefile index c559ce9517b2..c780768df4d2 100644 --- a/lib/libwrap/Makefile +++ b/lib/libwrap/Makefile @@ -17,6 +17,9 @@ CFLAGS+=-DFACILITY=LOG_AUTH -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ -DSYS_ERRLIST_DEFINED -DALWAYS_HOSTNAME -DUSE_STRSEP -DPROCESS_OPTIONS +.if defined(NO_NIS) +CFLAGS+= -DUSE_GETDOMAIN +.endif .if !defined(NOINET6) CFLAGS+=-DINET6 .endif diff --git a/libexec/Makefile b/libexec/Makefile index bfda5e41aedd..100cd04d628e 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -12,7 +12,7 @@ SUBDIR= atrun \ ${_lukemftpd} \ ${_mail.local} \ makekey \ - mknetid \ + ${_mknetid} \ pppoed \ pt_chown \ rbootd \ @@ -32,7 +32,12 @@ SUBDIR= atrun \ tcpd \ telnetd \ tftpd \ - ypxfr + ${_ypxfr} + +.if !defined(NO_NIS) +_mknetid= mknetid +_ypxfr= ypxfr +.endif .if !defined(NO_PF) _ftp-proxy= ftp-proxy diff --git a/rescue/librescue/Makefile b/rescue/librescue/Makefile index c53c23d543d2..f73984cd83a0 100644 --- a/rescue/librescue/Makefile +++ b/rescue/librescue/Makefile @@ -30,7 +30,10 @@ CFLAGS+= -DPOSIX_MISTAKE # libc/rpc/Makefile.inc CFLAGS+= -DBROKEN_DES -DPORTMAP -DDES_BUILTIN # libc/Makefile -CFLAGS+= -DYP -DHESIOD +.if !defined(NO_NIS) +CFLAGS+= -DYP +.endif +CFLAGS+= -DHESIOD CFLAGS+= -I${.CURDIR}/../../lib/libc/include .include diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf index 4e136fa7dfc7..00976307fe39 100644 --- a/share/examples/etc/make.conf +++ b/share/examples/etc/make.conf @@ -132,6 +132,7 @@ #NO_MAILWRAPPER= # do not build the mailwrapper(8) MTA selector #NOMAN= # do not build manual pages #NO_MODULES= # do not build modules with the kernel +#NO_NIS= # do not build NIS support and related programs #NO_OBJC= # do not build Objective C support #NO_OPENSSH= # do not build OpenSSH #NO_OPENSSL= # do not build OpenSSL (implies NO_KERBEROS/NO_OPENSSH) diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 19e5f811d0f3..dbe2c7d2ac33 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -97,13 +97,17 @@ LIBPAM+= ${LIBKRB5} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} \ MINUSLPAM+= -lkrb5 -lasn1 -lcrypto -lcrypt -lroken -lcom_err .endif LIBPAM+= ${LIBRADIUS} ${LIBTACPLUS} ${LIBCRYPT} \ - ${LIBUTIL} ${LIBOPIE} ${LIBMD} ${LIBYPCLNT} + ${LIBUTIL} ${LIBOPIE} ${LIBMD} MINUSLPAM+= -lradius -ltacplus -lcrypt \ - -lutil -lopie -lmd -lypclnt + -lutil -lopie -lmd .if !defined(NO_OPENSSH) && !defined(NOCRYPT) && !defined(NO_OPENSSL) LIBPAM+= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} MINUSLPAM+= -lssh -lcrypto -lcrypt .endif +.if !defined(NO_NIS) +LIBPAM+= ${LIBYPCLNT} +MINUSLPAM+= -lypclnt +.endif .endif LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a diff --git a/tools/tools/nanobsd/make.conf b/tools/tools/nanobsd/make.conf index 75e09d439d8e..09526ab419c8 100644 --- a/tools/tools/nanobsd/make.conf +++ b/tools/tools/nanobsd/make.conf @@ -28,6 +28,7 @@ NOLIBTHR= NO_LPR= NOMAN= NO_MODULES= +NO_NIS= NO_OBJC= NO_PF= NOPROFILE= @@ -37,7 +38,6 @@ NO_SENDMAIL= NO_SHAREDOCS= NO_TOOLCHAIN= NO_USB= -#NO_YP_LIBC= # If this macro is defined, UFS volume labels are used on # the flash image to avoid hardcoding device names. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 99c105a7c872..4be12bcb671b 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -221,9 +221,9 @@ SUBDIR= alias \ xstr \ ${_yacc} \ yes \ - ypcat \ - ypmatch \ - ypwhich + ${_ypcat} \ + ${_ypmatch} \ + ${_ypwhich} .if ${MACHINE_ARCH} != "arm" && \ ${MACHINE_ARCH} != "powerpc" @@ -250,6 +250,12 @@ _chkey= chkey _newkey= newkey .endif +.if !defined(NO_NIS) +_ypcat= ypcat +_ypmatch= ypmatch +_ypwhich= ypwhich +.endif + .if !defined(NO_SENDMAIL) _vacation= vacation .endif diff --git a/usr.bin/chkey/Makefile b/usr.bin/chkey/Makefile index 8cf1ef26e864..f3f5bd69dfcf 100644 --- a/usr.bin/chkey/Makefile +++ b/usr.bin/chkey/Makefile @@ -4,7 +4,10 @@ PROG= chkey SRCS= chkey.c generic.c update.c -CFLAGS+=-DYP -I${.CURDIR}/../newkey +CFLAGS+= -I${.CURDIR}/../newkey +.if !defined(NO_NIS) +CFLAGS+= -DYP +.endif DPADD= ${LIBRPCSVC} ${LIBMP} ${LIBCRYPTO} LDADD= -lrpcsvc -lmp -lcrypto diff --git a/usr.bin/chpass/Makefile b/usr.bin/chpass/Makefile index 8077152edfe7..a012ad8c011f 100644 --- a/usr.bin/chpass/Makefile +++ b/usr.bin/chpass/Makefile @@ -8,13 +8,19 @@ SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c BINOWN= root BINMODE=4555 WARNS?= 5 -CFLAGS+=-DYP +.if !defined(NO_NIS) +CFLAGS+= -DYP +.endif #Some people need this, uncomment to activate #CFLAGS+=-DRESTRICT_FULLNAME_CHANGE CFLAGS+=-I${.CURDIR}/../../usr.sbin/pwd_mkdb -I${.CURDIR}/../../lib/libc/gen -I. -DPADD= ${LIBCRYPT} ${LIBUTIL} ${LIBYPCLNT} -LDADD= -lcrypt -lutil -lypclnt +DPADD= ${LIBCRYPT} ${LIBUTIL} +LDADD= -lcrypt -lutil +.if !defined(NO_NIS) +DPADD+= ${LIBYPCLNT} +LDADD+= -lypclnt +.endif LINKS= ${BINDIR}/chpass ${BINDIR}/chfn LINKS+= ${BINDIR}/chpass ${BINDIR}/chsh diff --git a/usr.bin/newkey/Makefile b/usr.bin/newkey/Makefile index 6fa5f9697334..670aa3c01d6f 100644 --- a/usr.bin/newkey/Makefile +++ b/usr.bin/newkey/Makefile @@ -2,7 +2,9 @@ PROG= newkey SRCS= newkey.c generic.c update.c +.if !defined(NO_NIS) CFLAGS+= -DYP +.endif MAN= newkey.8 DPADD= ${LIBRPCSVC} ${LIBMP} ${LIBCRYPTO} LDADD= -lrpcsvc -lmp -lcrypto diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index a976e537cb8e..28d6bbb9c135 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -136,9 +136,9 @@ SUBDIR= ac \ rpc.lockd \ rpc.statd \ rpc.umntall \ - rpc.yppasswdd \ - rpc.ypupdated \ - rpc.ypxfrd \ + ${_rpc.yppasswdd} \ + ${_rpc.ypupdated} \ + ${_rpc.ypxfrd} \ rrenumd \ rtadvd \ rtprio \ @@ -175,12 +175,12 @@ SUBDIR= ac \ watchdogd \ wicontrol \ ${_wlconfig} \ - ypbind \ - yp_mkdb \ - yppoll \ - yppush \ - ypserv \ - ypset \ + ${_ypbind} \ + ${_yp_mkdb} \ + ${_yppoll} \ + ${_yppush} \ + ${_ypserv} \ + ${_ypset} \ zic \ ${_zzz} @@ -229,6 +229,18 @@ _ipsend= ipsend _iptest= iptest .endif +.if !defined(NO_NIS) +_rpc.yppasswdd= rpc.yppasswdd +_rpc.ypupdated= rpc.ypupdated +_rpc.ypxfrd= rpc.ypxfrd +_ypbind= ypbind +_yp_mkdb= yp_mkdb +_yppoll= yppoll +_yppush= yppush +_ypserv= ypserv +_ypset= ypset +.endif + .if !defined(NO_PF) && !defined(NO_AUTHPF) _authpf= authpf .endif diff --git a/usr.sbin/amd/Makefile.inc b/usr.sbin/amd/Makefile.inc index dd65ed3a8029..612f9f7aa2d0 100644 --- a/usr.sbin/amd/Makefile.inc +++ b/usr.sbin/amd/Makefile.inc @@ -17,6 +17,9 @@ CFLAGS+= -I${.OBJDIR}/../include CFLAGS+= -I${.CURDIR}/../../../contrib/amd/include CFLAGS+= -I${.CURDIR}/../../../contrib/amd CFLAGS+= -DHAVE_CONFIG_H +.if defined(NO_NIS) +CFLAGS+= -DHAVE_LOCALCONFIG_H +.endif CFLAGS+= -DHOST_CPU=\"${MACHINE_ARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\" diff --git a/usr.sbin/amd/amd/Makefile b/usr.sbin/amd/amd/Makefile index eb30395a46d2..592268801eb6 100644 --- a/usr.sbin/amd/amd/Makefile +++ b/usr.sbin/amd/amd/Makefile @@ -15,7 +15,7 @@ SRCS+= am_ops.c amd.c amfs_auto.c amfs_direct.c amfs_error.c SRCS+= amfs_host.c amfs_inherit.c amfs_link.c amfs_linkx.c amfs_nfsl.c SRCS+= amfs_nfsx.c amfs_program.c amfs_root.c amfs_toplvl.c SRCS+= amfs_union.c amq_subr.c amq_svc.c autil.c clock.c conf.c -SRCS+= get_args.c info_file.c info_hesiod.c info_ndbm.c info_nis.c info_passwd.c +SRCS+= get_args.c info_file.c info_hesiod.c info_ndbm.c info_passwd.c SRCS+= info_union.c map.c mapc.c mntfs.c nfs_prot_svc.c nfs_start.c SRCS+= nfs_subr.c ops_cdfs.c ops_mfs.c ops_nfs.c ops_nfs3.c SRCS+= ops_nullfs.c ops_pcfs.c ops_tfs.c ops_ufs.c ops_umapfs.c @@ -39,4 +39,8 @@ CLEANFILES+= mount_xdr.c mount_xdr.c: ${MOUNT_X} ${RPCCOM} -c -DWANT_NFS3 ${MOUNT_X} -o ${.TARGET} +.if !defined(NO_NIS) +SRCS+= info_nis.c +.endif + .include diff --git a/usr.sbin/amd/include/Makefile b/usr.sbin/amd/include/Makefile index d3cf00021203..7fa54aefe69a 100644 --- a/usr.sbin/amd/include/Makefile +++ b/usr.sbin/amd/include/Makefile @@ -8,6 +8,9 @@ # $NetBSD: Makefile,v 1.8 1998/08/08 22:33:37 christos Exp $ SRCS= config_local.h +.if defined(NO_NIS) +SRCS+= localconfig.h +.endif CLEANFILES= ${SRCS} all depend: ${SRCS} @@ -16,4 +19,9 @@ config_local.h: newvers.sh @rm -f ${.TARGET} sh ${.ALLSRC} ${.CURDIR}/../../../sys/conf/newvers.sh > ${.TARGET} +localconfig.h: + @rm -f ${.TARGET} + @echo "/* NIS disabled by NO_NIS make.conf option */" >> ${.TARGET} + @echo "#undef HAVE_MAP_NIS" >> ${.TARGET} + .include diff --git a/usr.sbin/bootparamd/bootparamd/Makefile b/usr.sbin/bootparamd/bootparamd/Makefile index 11c639048a12..af8a0dcffdc7 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 159124e008ad..238686bcdc1d 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 #include #include +#endif #include "bootparam_prot.h" #include #include @@ -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); diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile index 86e7edacade4..6dd1509c9e49 100644 --- a/usr.sbin/sendmail/Makefile +++ b/usr.sbin/sendmail/Makefile @@ -26,7 +26,9 @@ BINMODE=2555 # Define the database format to use for aliases et al. DBMDEF= -DNEWDB # If you don't want NIS alias/map support, comment out this line +.if !defined(NO_NIS) NIS= -DNIS +.endif # Map extensions MAPS= -DMAP_REGEX -DDNSMAP