Subject: bin/10415: Patch to disable kerberos support in different programs
To: None <gnats-bugs@gnats.netbsd.org>
From: Bernd Ernesti <bernd@arresum.inka.de>
List: netbsd-bugs
Date: 06/22/2000 06:31:14
>Number:         10415
>Category:       bin
>Synopsis:       Patch to disable kerberos support in different programs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 22 06:32:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bernd Ernesti
>Release:        NetBSD-current 1.5A 22-06-2000 1200 GMT
>Organization:
	
>Environment:
System: NetBSD arresum.inka.de 1.5A NetBSD 1.5A (ARRESUM) #454: Thu Jun 22 11:22:58 MEST 2000 bernd@arresum.inka.de:/home/work/obj_i386/src.i386/sys/arch/i386/compile/ARRESUM i386


>Description:
	crypto-intl had support to build different programs without kerberos,
	but the new crypto source no longer has that.
	This would partly fix bin/1041[34].

	I didn't add a patch for telnet(1) and telnetd(8), because you need to
	compile a new libtelnet without kerberos support to build the two programs
	without kerberos support.

	You don't need to do that for passwd(1), login(1) and su(1).
>How-To-Repeat:
>Fix:
	Apply this patch:

Index: share/mk/bsd.own.mk
===================================================================
RCS file: /cvsroot/sharesrc/share/mk/bsd.own.mk,v
retrieving revision 1.136
diff -c -r1.136 bsd.own.mk
*** bsd.own.mk	2000/05/02 11:44:20	1.136
--- bsd.own.mk	2000/06/22 12:24:57
***************
*** 13,22 ****
  SKEY=		yes
  # Defining `KERBEROS' causes support for Kerberos authentication to be
  # compiled in.
! #KERBEROS=	yes
  # Defining 'KERBEROS5' causes support for Kerberos5 authentication to be
  # compiled in.
! #KERBEROS5=	yes
  
  # where the system object and source trees are kept; can be configurable
  # by the user in case they want them in ~/foosrc and ~/fooobj, for example
--- 13,22 ----
  SKEY=		yes
  # Defining `KERBEROS' causes support for Kerberos authentication to be
  # compiled in.
! KERBEROS?=	yes
  # Defining 'KERBEROS5' causes support for Kerberos5 authentication to be
  # compiled in.
! KERBEROS5?=	yes
  
  # where the system object and source trees are kept; can be configurable
  # by the user in case they want them in ~/foosrc and ~/fooobj, for example
Index: usr.bin/login/Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/login/Makefile,v
retrieving revision 1.29
diff -c -r1.29 Makefile
*** Makefile	2000/06/20 06:00:36	1.29
--- Makefile	2000/06/22 12:24:57
***************
*** 18,29 ****
  LDADD+=	-lskey
  .endif
  
  SRCS+= k5login.c
  CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
! LDADD+= -lkrb5 -lcrypto -lasn1 -lcom_err -lroken
  
  SRCS+= klogin.c
  CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
  LDADD+= -lkrb
  
  .include <bsd.prog.mk>
--- 18,44 ----
  LDADD+=	-lskey
  .endif
  
+ .if (${KERBEROS5} == "yes")
  SRCS+= k5login.c
  CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
! LDADD+= -lkrb5 -lasn1
! DPADD+= ${LIBKRB5} ${LIBASN1}
! .else
! CLEANFILES+=k5login.o
! .endif
  
+ .if (${KERBEROS} == "yes")
  SRCS+= klogin.c
  CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
  LDADD+= -lkrb
+ DPADD+= ${LIBKRB}
+ .else
+ CLEANFILES+=klogin.o
+ .endif
+ 
+ .if (${KERBEROS} == "yes") || (${KERBEROS5} == "yes")
+ LDADD+= -lcrypto -lroken -lcom_err
+ DPADD+= ${LIBCRYPTO} ${LIBCOM_ERR} ${LIBROKEN}
+ .endif
  
  .include <bsd.prog.mk>
Index: usr.bin/passwd/Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/passwd/Makefile,v
retrieving revision 1.25
diff -c -r1.25 Makefile
*** Makefile	2000/06/20 06:00:37	1.25
--- Makefile	2000/06/22 12:24:58
***************
*** 16,24 ****
  INSTALLFLAGS=-fschg
  .endif
  
  CPPFLAGS+= -DKERBEROS5 -I${DESTDIR}/usr/include/krb5
  SRCS+=	krb5_passwd.c
! LDADD+=	-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lcrypt
  
  .include <bsd.prog.mk>
  
--- 16,31 ----
  INSTALLFLAGS=-fschg
  .endif
  
+ .include <bsd.own.mk>
+ 
+ .if (${KERBEROS5} == "yes")
  CPPFLAGS+= -DKERBEROS5 -I${DESTDIR}/usr/include/krb5
  SRCS+=	krb5_passwd.c
! LDADD+=	-lkrb5 -lcrypto -lasn1 -lcom_err -lroken
! DPADD+= ${LIBKRB5} ${LIBCRYPTO} ${LIBASN1} ${LIBCOM_ERR} ${LIBROKEN}
! .else
! CLEANFILES+=krb5_passwd.o
! .endif
  
  .include <bsd.prog.mk>
  
Index: usr.bin/su/Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/su/Makefile,v
retrieving revision 1.18
diff -c -r1.18 Makefile
*** Makefile	2000/06/20 06:00:38	1.18
--- Makefile	2000/06/22 12:24:58
***************
*** 13,28 ****
  #
  #CPPFLAGS+=-DSUGROUP=\"sugroup\"
  
  .ifdef AFS
  DPADD+= ${LIBKAFS}
  LDADD+= -lkafs
  .endif
  
  CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
  DPADD+= ${LIBKRB} ${LIBDES} ${LIBCOM_ERR} ${LIBROKEN}
  LDADD+= -lkrb -ldes -lcom_err -lroken
! 
! .include <bsd.prog.mk>
  
  .ifdef SKEY
  CPPFLAGS+=-DSKEY
--- 13,30 ----
  #
  #CPPFLAGS+=-DSUGROUP=\"sugroup\"
  
+ .include <bsd.own.mk>
+ 
  .ifdef AFS
  DPADD+= ${LIBKAFS}
  LDADD+= -lkafs
  .endif
  
+ .if (${KERBEROS} == "yes")
  CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
  DPADD+= ${LIBKRB} ${LIBDES} ${LIBCOM_ERR} ${LIBROKEN}
  LDADD+= -lkrb -ldes -lcom_err -lroken
! .endif
  
  .ifdef SKEY
  CPPFLAGS+=-DSKEY
***************
*** 33,35 ****
--- 35,39 ----
  .ifdef SUROOTAUTH
  CPPFLAGS+=-DROOTAUTH=\"${SUROOTAUTH}\"
  .endif
+ 
+ .include <bsd.prog.mk>
>Release-Note:
>Audit-Trail:
>Unformatted: