$NetBSD: patch-ad,v 1.2 2004/07/19 00:08:41 kristerw Exp $

--- mod_auth_mysql.c.orig	Sun Jun 27 13:34:55 2004
+++ mod_auth_mysql.c	Mon Jul 19 01:57:11 2004
@@ -29,14 +29,14 @@
 #define SNPRINTF apr_snprintf
 #define PSTRDUP apr_pstrdup
 #define PSTRCAT apr_pstrcat
-#define APACHELOG(severity, handle, message ...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_##severity, 0, handle->server, message)
+#define APACHELOG(severity, handle, message...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_##severity, 0, handle->server, message)
 #else
 #define PALLOC ap_palloc
 #define PCALLOC ap_pcalloc
 #define SNPRINTF ap_snprintf
 #define PSTRDUP ap_pstrdup
 #define PSTRCAT ap_pstrcat
-#define APACHELOG(severity, handle, message ...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_##severity, handle->server, message)
+#define APACHELOG(severity, handle, message...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_##severity, handle->server, message)
 #endif
 
 #include <httpd.h>
@@ -94,7 +94,7 @@
 #define CRYPT_MD5_ENCRYPTION_FLAG	1<<3
 #endif
 #define PHP_MD5_ENCRYPTION_FLAG		1<<4
-#ifdef HAVE_CRYPT_H
+#if defined(HAVE_CRYPT_H) || defined(HAVE_LIBCRYPT)
 #define CRYPT_ENCRYPTION_FLAG		1<<5
 #endif
 
@@ -126,7 +126,7 @@
 }
 #endif
 
-#ifdef HAVE_CRYPT_H
+#if defined(HAVE_CRYPT_H) || defined(HAVE_LIBCRYPT)
 static int check_crypt_encryption(const char *passwd, char *enc_passwd)
 {
 	return (!strcmp(crypt(passwd, enc_passwd), enc_passwd));
@@ -206,7 +206,9 @@
 #if CRYPT_MD5
 	{ "Crypt_MD5",		check_crypt_MD5_encryption,		CRYPT_MD5_ENCRYPTION_FLAG },
 #endif
+#if defined(HAVE_CRYPT_H) || defined(HAVE_LIBCRYPT)
 	{ "Crypt",		check_crypt_encryption,			CRYPT_ENCRYPTION_FLAG },
+#endif
 	{ "PHP_MD5",		check_PHP_MD5_encryption,		PHP_MD5_ENCRYPTION_FLAG	},
 	/* add additional encryption types below */
 	{ NULL,			NULL,					0 }
@@ -1463,14 +1465,17 @@
 		return res;
 	}
 
+#ifdef APACHE2
 	APACHELOG(DEBUG, r,
 		"Starting basic user auth for [%s] in %s, child pid %i",
-#ifdef APACHE2
 		r->user,
+		sec->dir, getpid());
 #else
+	APACHELOG(DEBUG, r,
+		"Starting basic user auth for [%s] in %s, child pid %i",
 		c->user,
-#endif
 		sec->dir, getpid());
+#endif
 
 #ifdef APACHE2
 	switch (mysql_check_user_password(r, r->user, sent_pw, sec)) {
