From 6e1e925c3671f13eb1fdc6279fa7bd6f9a2d2b5c Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 27 Jun 2005 20:27:38 +0000 Subject: [PATCH] Allow the CTYPE macros to be disabled, forcing procedure calls to be used instead. Disable the CTYPE macros in libskey, libutil, and libcrypt. This allows pre-1.3 programs linked against libc.so.3 to use the PAM modules in HEAD. these modules indirectly reference libskey, libutil, and libcrypt, which then fail to dynamically link against libc.so.3 due to references to ctype globals that do not exist in libc.so.3. This is a hack, I know, but we have to make upgrades as compatible as possible with older programs. --- include/ctype.h | 9 ++++++--- lib/libcrypt/Makefile | 3 ++- lib/libskey/Makefile | 3 ++- lib/libutil/Makefile | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/ctype.h b/include/ctype.h index 1befaae9ca..8fc9ccf546 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,6 +1,3 @@ -/* $NetBSD: src/include/ctype.h,v 1.25 2003/10/22 15:51:18 kleink Exp $ */ -/* $DragonFly: src/include/ctype.h,v 1.11 2005/05/09 09:53:07 y0netan1 Exp $ */ - /* * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. @@ -35,6 +32,8 @@ * SUCH DAMAGE. * * @(#)ctype.h 5.3 (Berkeley) 4/3/91 + * $NetBSD: src/include/ctype.h,v 1.25 2003/10/22 15:51:18 kleink Exp $ + * $DragonFly: src/include/ctype.h,v 1.12 2005/06/27 20:27:35 dillon Exp $ */ #ifndef _CTYPE_H_ @@ -87,6 +86,8 @@ int isblank(int); #endif __END_DECLS +#if !defined(_CTYPE_H_DISABLE_MACROS_) + #define isdigit(c) ((int)((__libc_ctype_ + 1)[(int)(c)] & _D)) #define islower(c) ((int)((__libc_ctype_ + 1)[(int)(c)] & _L)) #define isspace(c) ((int)((__libc_ctype_ + 1)[(int)(c)] & _S)) @@ -123,4 +124,6 @@ extern const __int16_t __libc_C_toupper_[]; extern const __int16_t __libc_C_tolower_[]; #endif +#endif /* !_CTYPE_H_DISABLE_MACROS_ */ + #endif /* !_CTYPE_H_ */ diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile index 9fc3b61e73..b571cea15a 100644 --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -1,6 +1,6 @@ # # $FreeBSD: src/lib/libcrypt/Makefile,v 1.24.2.4 2001/07/16 03:28:26 peter Exp $ -# $DragonFly: src/lib/libcrypt/Makefile,v 1.4 2005/04/21 13:42:33 joerg Exp $ +# $DragonFly: src/lib/libcrypt/Makefile,v 1.5 2005/06/27 20:27:36 dillon Exp $ # SHLIB_MAJOR= 3 @@ -12,6 +12,7 @@ MAN= crypt.3 MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3 CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil CFLAGS+= -DLIBC_SCCS -Wall +CFLAGS+= -D_CTYPE_H_DISABLE_MACROS_ # Pull in the crypt-des.c source, assuming it is present. .if exists(${.CURDIR}/../../secure/lib/libcrypt/crypt-des.c) && \ !defined(NOCRYPT) diff --git a/lib/libskey/Makefile b/lib/libskey/Makefile index a40b065763..733b88663b 100644 --- a/lib/libskey/Makefile +++ b/lib/libskey/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 5.4 (Berkeley) 5/7/91 # $FreeBSD: src/lib/libskey/Makefile,v 1.15.2.1 2001/04/25 10:04:40 ru Exp $ -# $DragonFly: src/lib/libskey/Makefile,v 1.3 2005/02/28 13:14:08 joerg Exp $ +# $DragonFly: src/lib/libskey/Makefile,v 1.4 2005/06/27 20:27:37 dillon Exp $ LIB= skey SRCS= skeyaccess.c put.c skey_crypt.c skey_getpass.c skeylogin.c skeysubr.c @@ -13,6 +13,7 @@ MLINKS= skey.3 skeylookup.3 skey.3 skeyverify.3 skey.3 skeychallenge.3 \ MAN+= skey.access.5 CFLAGS+=-DPERMIT_CONSOLE -D_SKEY_INTERNAL -I${.CURDIR} +CFLAGS+=-D_CTYPE_H_DISABLE_MACROS_ CFLAGS+=-W -Wall DPADD+= ${LIBCRYPT} ${LIBMD} diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 762ef1263e..e14c95c948 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,11 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libutil/Makefile,v 1.33.2.4 2001/04/25 10:04:42 ru Exp $ -# $DragonFly: src/lib/libutil/Makefile,v 1.5 2005/04/21 13:42:34 joerg Exp $ +# $DragonFly: src/lib/libutil/Makefile,v 1.6 2005/06/27 20:27:38 dillon Exp $ LIB= util SHLIB_MAJOR= 4 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} -I${.CURDIR}/../../sys CFLAGS+=-DINET6 +CFLAGS+=-D_CTYPE_H_DISABLE_MACROS_ SRCS= login.c login_tty.c logout.c logwtmp.c pty.c \ login_cap.c login_class.c login_auth.c login_times.c login_ok.c \ login_crypt.c _secure_path.c uucplock.c property.c auth.c \ -- 2.41.0