diff options
author | wpaul <wpaul@FreeBSD.org> | 1998-09-16 01:50:04 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1998-09-16 01:50:04 +0000 |
commit | 71a9e7d996a044d038f1a8e63327258812282bba (patch) | |
tree | eebf6d71287460b2f8a919dffb61647400696f52 /usr.sbin/keyserv | |
parent | f63b826ac0d88951abe0ed5e24be58a7ef145392 (diff) | |
download | FreeBSD-src-71a9e7d996a044d038f1a8e63327258812282bba.zip FreeBSD-src-71a9e7d996a044d038f1a8e63327258812282bba.tar.gz |
Apply patch from Stefan Esser to close PR #7941: add code to handle
dynamic loading of libdes on ELF systems. The patch looks correct to
me.
Diffstat (limited to 'usr.sbin/keyserv')
-rw-r--r-- | usr.sbin/keyserv/Makefile | 5 | ||||
-rw-r--r-- | usr.sbin/keyserv/crypt_server.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/keyserv/Makefile b/usr.sbin/keyserv/Makefile index a6bb9a4..f08135f 100644 --- a/usr.sbin/keyserv/Makefile +++ b/usr.sbin/keyserv/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1997/12/16 17:43:23 bde Exp $ +# $Id: Makefile,v 1.3 1998/05/09 13:32:37 bde Exp $ PROG= keyserv SRCS= keyserv.c setkey.c keyserv_uid.c crypt_svc.c crypt_server.c crypt.h @@ -6,6 +6,9 @@ SRCS= keyserv.c setkey.c keyserv_uid.c crypt_svc.c crypt_server.c crypt.h MAN8= keyserv.8 CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I. +.if $(OBJFORMAT) == elf +CFLAGS+= -DOBJFORMAT_ELF +.endif DPADD= ${LIBMP} ${LIBRPCSVC} LDADD= -lmp -lrpcsvc diff --git a/usr.sbin/keyserv/crypt_server.c b/usr.sbin/keyserv/crypt_server.c index ff3f460..5b944ae 100644 --- a/usr.sbin/keyserv/crypt_server.c +++ b/usr.sbin/keyserv/crypt_server.c @@ -44,7 +44,7 @@ #ifndef lint static const char rcsid[] = - "$Id$"; + "$Id: crypt_server.c,v 1.3 1997/09/23 06:36:26 charnier Exp $"; #endif /* not lint */ /* @@ -171,7 +171,11 @@ static void *dlhandle; #endif #ifndef LIBDES +#ifdef OBJFORMAT_ELF +#define LIBDES "libdes.so.3" +#else #define LIBDES "libdes.so.3." +#endif /* OBJFORMAT_ELF */ #endif void load_des(warn, libpath) @@ -185,6 +189,9 @@ void load_des(warn, libpath) int len; if (libpath == NULL) { +#ifdef OBJFORMAT_ELF + snprintf(dlpath, sizeof(dlpath), "%s/%s", _PATH_USRLIB, LIBDES); +#else len = strlen(LIBDES); if ((dird = opendir(_PATH_USRLIB)) == NULL) err(1, "opendir(/usr/lib) failed"); @@ -203,11 +210,16 @@ void load_des(warn, libpath) } closedir(dird); +#endif /* OBJFORMAT_ELF */ } else snprintf(dlpath, sizeof(dlpath), "%s", libpath); if (dlpath != NULL && (dlhandle = dlopen(dlpath, 0444)) != NULL) +#ifdef OBJFORMAT_ELF + _my_crypt = (int (*)())dlsym(dlhandle, "_des_crypt"); +#else _my_crypt = (int (*)())dlsym(dlhandle, "__des_crypt"); +#endif /* OBJFORMAT_ELF */ if (_my_crypt == NULL) { if (dlhandle != NULL) |