🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by Jeff Baker Mon, 14 Sep 1998 00:00
Help. News Server w/ LDAP authentication ?
#31374
Author: Jeff Baker
Date: Mon, 14 Sep 1998 00:00
13 lines
780 bytes
Anybody know of a decent news server that can use LDAP 
for authentication.  Please e-mail responses.

Thanks in advance,
Jeff Baker
jbaker@questra.com

/-----------------------\
| Jeff Baker            |
| jbaker@questra.com    |
\-----------------------/

Re: Help. News Server w/ LDAP authentication ?
#31744
Author: Ricardo Stella
Date: Fri, 25 Sep 1998 00:00
29 lines
1699 bytes
Netscape's collabra, but it's not free.

I guess somehow whatever controls nnrp.access could be hacked to
remotely authenticate.  In that case using a PERL script and PerlLDAP
should do it.

I asked the same question a few months ago and got no reply whatsoever.

Jeff Baker wrote:
> 
> Anybody know of a decent news server that can use LDAP
> for authentication.  Please e-mail responses.
> 
> Thanks in advance,
> Jeff Baker
> jbaker@questra.com
> 
> /-----------------------\
> | Jeff Baker            |
> | jbaker@questra.com    |
> \-----------------------/

-- 
------------------------------------------------------------------
 Ricardo Stella                                  O.I.T.
 (609)896-5000 x7436           _suAve_           Rider University
  *** Remove 'no-spam' from e-mail address before replying.  ***

Re: Help. News Server w/ LDAP authentication ?
#31780
Author: Alex French
Date: Sun, 27 Sep 1998 00:00
19 lines
1383 bytes
On Fri, 25 Sep 1998 17:14:10 -0400, Ricardo Stella
<stella@NO-SPAM.rider.edu> was rumoured to have said:

>Netscape's collabra, but it's not free.
>
>I guess somehow whatever controls nnrp.access could be hacked to
>remotely authenticate.  In that case using a PERL script and PerlLDAP
>should do it.
>
>I asked the same question a few months ago and got no reply whatsoever.
>


If you look at the thread I started above, someone's just posted a
patch for nnrpd to allow you to authenticate using an arbitrary prog.

Alex

Re: Help. News Server w/ LDAP authentication ?
#32323
Author: Keith Lewis
Date: Mon, 19 Oct 1998 00:00
153 lines
4757 bytes
-----BEGIN PGP SIGNED MESSAGE-----

Ricardo Stella <stella@NO-SPAM.rider.edu> writes:
>Netscape's collabra, but it's not free.
>I guess somehow whatever controls nnrp.access could be hacked to
>remotely authenticate.  In that case using a PERL script and PerlLDAP
>should do it.
>I asked the same question a few months ago and got no reply whatsoever.
>Jeff Baker wrote:
>> Anybody know of a decent news server that can use LDAP
>> for authentication.  Please e-mail responses.

	I recently wrote a small c program that links against openldap and
modified nnrpd.c to call it.

	It works for me.

	Steps are:

1) Get and install OpenLDAP from http://www.openldap.org/

2) Modify inn/nnrpd/nnrpd.c as follows:

#if HAVE_GETSPNAM
            if ((spwd = getspnam(user)) != NULL)
                pwd->pw_passwd = spwd->sp_pwdp;
#endif
            if (!EQ(pwd->pw_passwd, crypt(pass, pwd->pw_passwd)))
                continue;

!        /* KBL Fudge - look up in ldap */
!        } else if (user && EQ(fields[2], "LDAP")) {
!            if ( ! ldap_pwd_ok( user, pass ) )
!                continue;
!        /* end of kbl fudge */

        } else {

- ----------------------------------------------------------------------

3) edit the Makefile

LDFLAGS = -L/usr/local/lib
LIBS =  -lldap -llber

	And added ldap_pwd_ok.c to SOURCES and ldap_pwd_ok.o to OBJECTS

- ----------------------------------------------------------------------

4) copy ldapconfig.h from the OpenLDAP source into inn/nnrpd

- ----------------------------------------------------------------------

5) edit the nnrpd.access file:

  ## Default is no access, no way to authentication, and no groups.
  *:: -no- : -no- :!*
! *:Read Post:LDAP: :*

- ----------------------------------------------------------------------

6) create ldap_pwd_ok.c

#include <strings.h>
#include <errno.h>
#include <lber.h>
#include <ldap.h>

#include "ldapconfig.h"

int ldap_pwd_ok ( char *user, char *passwd) {
 char ldaphost[]="dirgod";	/* you need to parameterize this */
 LDAP *ld;
 LDAPMessage *res, *e;
 char filter[128];
 char *attrs[] = { "dn", 0 };
 char *dn;

 strcpy(filter,"(uid=");
 strcat(filter,user);
 strcat(filter,")");

 if (( ld = ldap_open( ldaphost,LDAP_PORT)) == NULL ) {
        perror( ldaphost );
        exit( 1 );
}

/* printf( "doing an unauth bind\n"); */

 if ( ldap_simple_bind_s( ld, LDAPSEARCH_BINDDN,  LDAPSEARCH_BIND_CRED )
 != LDAP_SUCCESS ) {
/*        ldap_perror( ld, "ldap_bind" ); */
        return(0);
 }

/* printf( "searching for user \n"); */

 if ( ldap_search_s( ld,  LDAPSEARCH_BASE, LDAP_SCOPE_SUBTREE, 
                      filter, attrs, 0, &res)
    != LDAP_SUCCESS ) {
/*        ldap_perror( ld, "ldap_usearch" ); */
        return(0);
 }

/* printf("getting first entry\n"); */

 e = ldap_first_entry( ld, res );
 if ( e == (LDAPMessage *) 0 ) {
/*      ldap_perror( ld, "ldap_esearch" ); */
        return(0);
 }
/* printf("getting dn\n"); */

 dn = ldap_get_dn( ld, e);

/* printf("dn is\n%s\n",dn); */

 ldap_unbind(ld);

/* printf("unbinding\n"); */

 if (( ld = ldap_open( ldaphost,LDAP_PORT)) == NULL ) {
/*        perror( ldaphost ); */
        return(0);
 }

/* printf("doing it\n"); */

 if ( ldap_simple_bind_s( ld, dn,  passwd )
 != LDAP_SUCCESS ) {
/*      ldap_perror( ld, "ldap_fsearch" );
        printf("tough luck\n"); */
        return(0);
 }
 return(1);
}

- ----------------------------------------------------------------------
Keith
(p.s. apologies for hadrcoding dirgod into the source...)

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBNivHdnEpE0nRVDfpAQGsqQP/Vm/AnlTF+EDht6pJcv6lD9oGyAN9Sehq
KW9stzfGeS2Np0lPaPE0fFMFfQwygtNTGIGUMpjty0H0ThOuH3GCUh8vbE7dKaSO
dyYqA71uhh1WhX5DegNtfIYXqdFEF8rSbrvozkAAeUTT0B5ohIgJzPZZnsmExCNv
JL5I0vV0o+Y=
=XyhF
-----END PGP SIGNATURE-----

Re: Help. News Server w/ LDAP authentication ?
#32343
Author: Paul Coen
Date: Tue, 20 Oct 1998 00:00
11 lines
1169 bytes
In article <70gh31$nhj$1@towncrier.cc.monash.edu.au>, keithl@mukluk.cc.monash.edu.au (Keith Lewis) writes:
> 	Steps are:
> 
> 1) Get and install OpenLDAP from http://www.openldap.org/

Which OpenLDAP components did you actually need?  Just the libraries,
or do you need to have ldapd, slapd or slurpd running?  I've only
recently picked up OpenLDAP, and I'm still in the "which piece
does what" staage.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads