Article View: news.software.nntp
Article #31723Re: Alternative nntp authentication methods?
From: John Payne
Date: Fri, 25 Sep 1998 00:00
Date: Fri, 25 Sep 1998 00:00
139 lines
5377 bytes
5377 bytes
On Fri, 25 Sep 1998 16:39:20 +0100, Alex French <alex@medianet.ie> wrote:
>Does anyone have a patch to let me use an arbitrary program to do nnrpd
>authentication? Or even better, to use tacacs+?
This is what we're using here... written by brian and applied to INN2.1
we will get around to inn.conf'ing the auth program, but lethargy etc
have delayed it
It works for us.... no promises or guarantees
*** nnrpd-orig.c Wed Jul 8 01:42:47 1998
--- nnrpd.c Fri Jul 31 02:24:02 1998
***************
*** 366,371 ****
--- 366,375 ----
char buff[BIG_BUFFER];
char filename[SMBUF];
char *fields[5];
+ /* <bln> */
+ int bln_rc;
+ char *bln_cmd;
+ char *bln_authp = "/usr/local/sbin/sack_nnrpd_auth";
if ((F = fopen(accessfile, "r")) == NULL) {
syslog(L_ERROR, "%s cant fopen %s %m", ClientHost, accessfile);
***************
*** 447,461 ****
} else
filename[0] = '\0';
! #ifdef DONT_HAVE_SHADOW
/* See if we should lookup a specific user in the passwd file */
if (user && pass && EQ(fields[2], "+")) {
if ((pwd = getpwnam(user)) == NULL)
continue;
if (!EQ(pwd->pw_passwd, crypt(pass, pwd->pw_passwd)))
continue;
- } else
#endif
/* Matching for a specific user or just the host? */
if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3])))
continue;
--- 451,483 ----
} else
filename[0] = '\0';
! /* #ifdef DONT_HAVE_SHADOW */
/* See if we should lookup a specific user in the passwd file */
if (user && pass && EQ(fields[2], "+")) {
+
+ /* <bln> */
+ bln_cmd = (char *) malloc(strlen(bln_authp) + strlen(user)
+ + strlen(pass) + 3);
+ strcpy(bln_cmd, bln_authp);
+ strcat(bln_cmd, " ");
+ strcat(bln_cmd, user);
+ strcat(bln_cmd, " ");
+ strcat(bln_cmd, pass);
+ bln_rc = system(bln_cmd);
+
+ if(bln_rc)
+ continue;
+
+ #ifdef 0
if ((pwd = getpwnam(user)) == NULL)
continue;
if (!EQ(pwd->pw_passwd, crypt(pass, pwd->pw_passwd)))
continue;
#endif
+ /* </bln> */
+
+ } else
+ /* #endif */
/* Matching for a specific user or just the host? */
if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3])))
continue;
***************
*** 463,468 ****
--- 485,497 ----
PERMcanread = strchr(fields[1], 'R') != NULL;
PERMcanpost = strchr(fields[1], 'P') != NULL;
PERMlocpost = strchr(fields[1], 'L') != NULL;
+
+ /* <bln> test */
+ if(PERMcanread && PERMcanpost) PERMlocpost = 1;
+ /* </bln> */
+
if (strchr(fields[1], 'N') != NULL) PERMnewnews = TRUE;
if (ForceReadOnly) PERMcanpost=FALSE;
(void)strcpy(PERMuser, user ? user : fields[2]);
and the comment block from sack_nnrpd_auth.c
/*
* sack_nnrpd_auth.c
*
* July 7, 1998 - Brian L. Naylor
*
* Simple password-checking program to be spawned from nnrpd.
* (We use MD5 passwords with PAM in /etc/passwd, and nnrpd
* doesn't come close to supporting that. There's already a
* patch for nnrpd to spawn an external passwd checker, so
* it's much easier just do write that than to hack in PAM
* support. impatience, *laziness*, and hubris.. :)
*
* User passwords reside in ~/.nntp_pass. This file must
* consist of exactly one line:
*
* plaintext_password
*
* ..and it must be a plain file of mode x00 or this program
* will return an error.
*
* In order to call this program, simply pass it two arguments:
* username and password. It will verify that the user exists,
* check the existence of ~/.nntp_pass and verify that its
* permissions are correct, and finally check that the password
* passed in matches the one in the file.
*
* Possible return codes:
*
* 0 - success; the light is green, the trap is clean
* 1 - failure; no such user
* 2 - failure; ~/.nntp_pass does not exist
* 3 - failure; ~/.nntp_pass is not a plain file
* 4 - failure; ~/.nntp_pass has incorrect ownership
* 5 - failure; ~/.nntp_pass is read- or write-able by group/other
* 6 - failure; passwords do not match
* 7 - failure; incorrect number of arguments
* 8 - failure; unknown error
*/
--
John Payne http://www.sackheads.org/jpayne john@sackheads.org
Sarcasm by request Fax: +44 870 0547954
My mail provider doesn't welcome UBE - http://www.sackheads.org/uce/
Technical Details
Message-ID:
<slrn70nh2p.svt.john+usenet@haybaler.sackheads.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<alex-2509981639200001@gzunda.medianet.ie>Show Full Headers
Complete Article Headers
Message-ID: <slrn70nh2p.svt.john+usenet@haybaler.sackheads.org> Subject: Re: Alternative nntp authentication methods? Date: Fri, 25 Sep 1998 00:00:00 +0000 From: john+usenet@sackheads.org (John Payne) References: <alex-2509981639200001@gzunda.medianet.ie> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 394772376 Sender: jpayne@localhost.sackheads.org X-Complaints-To: abuse@sackheads.org X-Trace: haybaler.sackheads.org 906740825 29694 127.0.0.1 (25 Sep 1998 16:27:05 GMT) Organization: sackHeads NNTP-Posting-Date: 25 Sep 1998 16:27:05 GMT Newsgroups: news.software.nntp