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
This commit is contained in:
bz 2004-11-13 20:40:32 +00:00
parent a67c7e7512
commit 4b83c5852a
25 changed files with 125 additions and 32 deletions

View File

@ -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"

View File

@ -107,7 +107,7 @@ _libthread_db= libthread_db
_libusbhid= libusbhid
.endif
.if !defined(NO_YP_LIBC)
.if !defined(NO_NIS)
_libypclnt= libypclnt
.endif

View File

@ -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

View File

@ -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();

View File

@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#ifdef YP
#include <rpc/rpc.h>
#ifdef YP
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
#endif

View File

@ -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 * );

View File

@ -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 <bsd.lib.mk>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <bsd.lib.mk>

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}\"

View File

@ -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 <bsd.prog.mk>

View File

@ -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 <bsd.prog.mk>

View File

@ -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}

View File

@ -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);

View File

@ -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