diff -urb inn-ldapcheck.orig/CHANGES inn-ldapcheck/CHANGES
--- inn-ldapcheck.orig/CHANGES	2002-03-12 11:10:09.000000000 +0100
+++ inn-ldapcheck/CHANGES	2005-12-16 13:00:06.000000000 +0100
@@ -1,3 +1,5 @@
+16 Dec 2005 Adapted for open-news-network.org
+	Don't perform admin bind, don't search for uid
 12 Mar 2002 With new makefile now compiles default with OpenLDAP, 
 	edit Makefile if you want iPlanet CSDK
 8 Jan 2002 Initial release
diff -urb inn-ldapcheck.orig/config.h inn-ldapcheck/config.h
--- inn-ldapcheck.orig/config.h	2002-01-08 11:09:21.000000000 +0100
+++ inn-ldapcheck/config.h	2005-12-16 12:37:21.000000000 +0100
@@ -3,12 +3,14 @@
 /* 2002 Bas Meijer */
 
 /* change these for your setup */
-#define LDAPSEARCH_BINDDN "cn=Manager,dc=example,dc=com"
-#define LDAPSEARCH_BIND_CRED "secret"
-#define LDAPSEARCH_BASE "dc=example,dc=com"
+#define LDAPSEARCH_BASE "dc=open-news-network,dc=org"
 
 #define LDAPPORT 389
 /* this is what stdin gets from newsreader */
 #define NAMESTR "ClientAuthname: "
 #define PASSSTR "ClientPassword: "
+
+#ifdef LDAP_SUCCESS
+#undef LDAP_SUCCESS
+#endif
 #define LDAP_SUCCESS 0
Only in inn-ldapcheck: ldapcheck
diff -urb inn-ldapcheck.orig/ldap_pwd_ok.c inn-ldapcheck/ldap_pwd_ok.c
--- inn-ldapcheck.orig/ldap_pwd_ok.c	2002-01-08 23:40:16.000000000 +0100
+++ inn-ldapcheck/ldap_pwd_ok.c	2005-12-16 13:24:57.000000000 +0100
@@ -14,72 +14,23 @@
 about it increase but, 32 is insecure for production since it logs the
 password */
 
-#define DEBUG 1
+#define DEBUG 0
 
 int ldap_pwd_ok ( char *ldaphost, char *user, char *passwd) {
 	//char ldaphost[]="localhost";
 	LDAP *ld;
-	LDAPMessage *res, *e;
-	char filter[128];
-	char *attrs[] = { "dn", 0 };
-	char *dn;
-
-	strcpy(filter,"(uid=");
-	strcat(filter,user);
-	strcat(filter,")");
+	char userdn[512];
 
-	if (( ld = ldap_open( ldaphost,LDAP_PORT)) == NULL ) {
-		   perror( ldaphost );
-		   exit( 1 );
-	}
-
-if(DEBUG>0) fprintf(stderr, "bind for search at %s\n",ldaphost); 
-
-
-	if ( ldap_simple_bind_s( ld, LDAPSEARCH_BINDDN,  LDAPSEARCH_BIND_CRED )
-		!= LDAP_SUCCESS ) {
-		   ldap_perror( ld, "ldap_bind" ); 
-		   return(0);
-	}
-
-if(DEBUG>1) fprintf(stderr, "searching dn for %s \n",user);  
-	if ( ldap_search_s( ld,  LDAPSEARCH_BASE, LDAP_SCOPE_SUBTREE,
-						 filter, attrs, 0, &res)
-	   != 0 ) {
-		ldap_perror( ld, "ldap_usearch" );
-		return(0);
-	}
-
-if(DEBUG>2) fprintf(stderr,"getting first entry\n");  
-	e = ldap_first_entry( ld, res );
-	if(res == NULL){
-		perror("failed search");
-	}
-	if ( e == (LDAPMessage *) 0 ) {
-		ldap_perror( ld, "ldap_esearch" ); 
-		return(0); 
-	}
-if(DEBUG>2) fprintf(stderr,"getting dn for %s\n",user);  
-	dn = ldap_get_dn( ld, e);
-	/* something wrong no value */
-	if(!dn){	
-		fprintf(stderr, "dn is not found in ldap://%s\n",ldaphost); 
-		ldap_unbind(ld);
-if(DEBUG>8) printf("user not found in ldap database\n");
-		exit(3);
-	}
-
-	ldap_unbind(ld);
-if(DEBUG>16) fprintf(stderr,"unbinding\n");
+	snprintf(userdn, 511, "uid=%s,%s", user, LDAPSEARCH_BASE);
 
 	if (( ld = ldap_open( ldaphost,LDAP_PORT)) == NULL ) {
 if(DEBUG>1) fprintf(stderr, "cannot open %s for authbind",ldaphost ); 
 		return(0);
 	}
 
-if(DEBUG) fprintf(stderr,"binding as %s at %s\n",dn,ldaphost); 
+if(DEBUG) fprintf(stderr,"binding as %s at %s\n",userdn,ldaphost); 
 
-	if ( ldap_simple_bind_s( ld, dn,  passwd )
+	if ( ldap_simple_bind_s( ld, userdn,  passwd )
 	!= LDAP_SUCCESS ) {
 		/* invalid credentials */
 		ldap_perror( ld, "ldap_fsearch" );
diff -urb inn-ldapcheck.orig/main.c inn-ldapcheck/main.c
--- inn-ldapcheck.orig/main.c	2002-01-08 10:54:31.000000000 +0100
+++ inn-ldapcheck/main.c	2005-12-16 12:28:36.000000000 +0100
@@ -8,6 +8,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/uio.h>
+#include <stdlib.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
diff -urb inn-ldapcheck.orig/Makefile inn-ldapcheck/Makefile
--- inn-ldapcheck.orig/Makefile	2002-03-12 11:03:38.000000000 +0100
+++ inn-ldapcheck/Makefile	2005-12-16 12:37:15.000000000 +0100
@@ -15,7 +15,7 @@
 # INCDIR=/usr/local/include
 
 LIBS=-L$(LIBDIR) $(LDAPLIB) -lpthread
-OPTFLAGS=-g
+OPTFLAGS=-O -Wall
 CFLAGS=$(OPTFLAGS) -I$(INCDIR)
 CC=cc
 
