From 9ca86a662f5dfd783f2c3160166006cfb5c44b6c Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 25 Jan 2021 21:53:36 -0800 Subject: [PATCH] Remove the check_unix_password functionality from uutils.c (#297) This code has not worked for a long time. Most systems now maintain the password entries so that a password is not accessible through the getpwent() interface. The SUBR that calls this interface may be removed at a future time. --- CMakeLists.txt | 4 ---- bin/makefile-cygwin.x86_64-x | 4 ++-- bin/makefile-freebsd.386-x | 2 +- bin/makefile-linux.386-x | 4 ++-- bin/makefile-linux.armv7l-x | 4 ++-- bin/makefile-linux.x86_64-x | 4 ++-- src/uutils.c | 21 --------------------- 7 files changed, 9 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58a4718..5c31049 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,6 @@ IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") ENDIF() INCLUDE(CheckLibraryExists) -CHECK_LIBRARY_EXISTS(crypt crypt "" NEED_LIB_CRYPT) CHECK_LIBRARY_EXISTS(m fmod "" NEED_LIB_M) FIND_PACKAGE(X11 REQUIRED) @@ -408,9 +407,6 @@ ADD_LIBRARY(maiko STATIC ${MAIKO_SRCS} ${MAIKO_HDRS}) TARGET_COMPILE_DEFINITIONS(maiko PUBLIC ${MAIKO_DEFINITIONS}) TARGET_INCLUDE_DIRECTORIES(maiko PUBLIC inc) TARGET_LINK_LIBRARIES(maiko X11::X11) -IF(NEED_LIB_CRYPT) - TARGET_LINK_LIBRARIES(maiko crypt) -ENDIF() IF(NEED_LIB_M) TARGET_LINK_LIBRARIES(maiko m) ENDIF() diff --git a/bin/makefile-cygwin.x86_64-x b/bin/makefile-cygwin.x86_64-x index 7dc2b8b..f1df5c3 100644 --- a/bin/makefile-cygwin.x86_64-x +++ b/bin/makefile-cygwin.x86_64-x @@ -24,8 +24,8 @@ DFLAGS = -DAIX \ -DBYTESWAP -DLOGINT $(XFLAGS) \ -DRELEASE=351 -LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt -LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm OBJECTDIR = ../$(RELEASENAME)/ diff --git a/bin/makefile-freebsd.386-x b/bin/makefile-freebsd.386-x index 7d02692..ba88fa7 100644 --- a/bin/makefile-freebsd.386-x +++ b/bin/makefile-freebsd.386-x @@ -22,7 +22,7 @@ OPTFLAGS = -O1 -gdwarf-2 DFLAGS = -DBYTESWAP -DLOGINT $(XFLAGS) \ -DRELEASE=351 -LDFLAGS = -L/usr/local/lib -lX11 -lc -lm -lcrypt +LDFLAGS = -L/usr/local/lib -lX11 -lc -lm LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm OBJECTDIR = ../$(RELEASENAME)/ diff --git a/bin/makefile-linux.386-x b/bin/makefile-linux.386-x index 0485110..3118c94 100644 --- a/bin/makefile-linux.386-x +++ b/bin/makefile-linux.386-x @@ -23,8 +23,8 @@ DFLAGS = -DAIX \ -DBYTESWAP -DLOGINT $(XFLAGS) \ -DRELEASE=351 -LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt -LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm OBJECTDIR = ../$(RELEASENAME)/ diff --git a/bin/makefile-linux.armv7l-x b/bin/makefile-linux.armv7l-x index ea71cd9..10c171e 100644 --- a/bin/makefile-linux.armv7l-x +++ b/bin/makefile-linux.armv7l-x @@ -23,8 +23,8 @@ DFLAGS = -DAIX \ -DBYTESWAP -DLOGINT $(XFLAGS) \ -DRELEASE=351 -LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt -LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm OBJECTDIR = ../$(RELEASENAME)/ diff --git a/bin/makefile-linux.x86_64-x b/bin/makefile-linux.x86_64-x index 7dc2b8b..f1df5c3 100644 --- a/bin/makefile-linux.x86_64-x +++ b/bin/makefile-linux.x86_64-x @@ -24,8 +24,8 @@ DFLAGS = -DAIX \ -DBYTESWAP -DLOGINT $(XFLAGS) \ -DRELEASE=351 -LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt -LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm OBJECTDIR = ../$(RELEASENAME)/ diff --git a/src/uutils.c b/src/uutils.c index 693b115..615f95a 100644 --- a/src/uutils.c +++ b/src/uutils.c @@ -137,28 +137,7 @@ int c_string_to_lisp_string(char *C, LispPTR Lisp) { /************************************************************************/ LispPTR check_unix_password(LispPTR *args) { -#ifndef DOS - struct passwd *pwd; -#ifndef OS5 - char *crypt(const char *, const char *); -#endif /* OS5 */ - char salt[3]; - char name[100], pass[100]; - - if (lisp_string_to_c_string(args[0], name, sizeof name)) { return NIL; } - if (lisp_string_to_c_string(args[1], pass, sizeof pass)) { return NIL; } - - if ((pwd = getpwnam(name)) == 0) { return (NIL); /* can't find entry for name */ } - salt[0] = pwd->pw_passwd[0]; - salt[1] = pwd->pw_passwd[1]; - salt[2] = '\0'; - if (strcmp((char *)crypt(pass, salt), pwd->pw_passwd) == 0) - return (ATOM_T); - else - return (NIL); -#else return ATOM_T; -#endif /* DOS */ } /************************************************************************/