From dcbc2eec155f1abda6e3f21555f114996b0079d4 Mon Sep 17 00:00:00 2001 From: Brian Feldman Date: Fri, 27 Oct 2000 01:19:02 +0000 Subject: Fix problems people were having with large -O levels with GCC and getting libutil/libcrypt to work properly. I've determined that GCC thinks it can inline all functions, including weak-symboled ones, if it feels like it. Create a new stub.c and move any stubs there to prevent inlining. Thanks to jdp and William S. Duncanson for helping me finally find the problem. --- libutil/login_crypt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libutil') diff --git a/libutil/login_crypt.c b/libutil/login_crypt.c index b291100..e080ba9 100644 --- a/libutil/login_crypt.c +++ b/libutil/login_crypt.c @@ -29,19 +29,18 @@ #include #include +#include +#include #include -#pragma weak crypt_set_format -int -crypt_set_format(const char *f) { - return (0); -} - const char * login_setcryptfmt(login_cap_t *lc, const char *def, const char *error) { const char *cipher; - cipher = login_getcapstr(lc, "passwd_format", def, NULL); + cipher = login_getcapstr(lc, "passwd_format", (char *)def, NULL); + if (getenv("CRYPT_DEBUG") != NULL) + fprintf(stderr, "login_setcryptfmt: " + "passwd_format = %s\n", cipher); if (cipher == NULL) return (error); if (!crypt_set_format(cipher)) -- cgit v1.2.3-56-ge451