Article View: news.software.nntp
Article #15020Re: Authorization and NNTP
From: Chris Bellomy
Date: Thu, 13 Feb 1997 00:00
Date: Thu, 13 Feb 1997 00:00
93 lines
3411 bytes
3411 bytes
Mike Horwath (drechsau@visi.com) wrote:
: In news.software.nntp Marc LAMBERT <lambert@u-paris10.fr> wrote:
: : In article <5ctp3a$623@excalibur.flash.net>, cbellomy@flash.net says...
: : >If you want to use the passwd file for authentication, set up
: : >a profile something like this in nnrp.access:
: : >
: : >*:R P:+:+:*
:
: : It works on a innd 1.5.1 version.
: : Do you know how to apply this on a previous version (1.4.3) ?
:
: What operating system does this work under?
:
: Standard Solaris 2.5.1 which is NIS client of a SunOS 4.1.4 system and
: it does *not* work.
The only way it will work as distributed is if you /etc/passwd for
everything, including passwords. If you use shadow passwords, it
will break.
Here is a patch I constructed to make this scheme work using shadow
passwords under Solaris 2.5.1. (CAUTION: I think I ran diff with the
files in reverse order. Let me know if this is so.)
*** nnrpd.c Tue Dec 31 16:14:09 1996
--- ../nnrpd/nnrpd.c Fri Nov 29 17:32:18 1996
***************
*** 11,17 ****
#define MAINLINE
#include "nnrpd.h"
#include <netdb.h>
- #include <shadow.h>
#include <pwd.h>
#if defined(HPUX)
#include <sys/pstat.h>
--- 11,16 ----
***************
*** 316,322 ****
register char *p;
register BOOL found;
register int i;
! struct spwd *pwd;
char buff[BIG_BUFFER];
char *fields[5];
--- 315,321 ----
register char *p;
register BOOL found;
register int i;
! struct passwd *pwd;
char buff[BIG_BUFFER];
char *fields[5];
***************
*** 355,363 ****
/* See if we should lookup a specific user in the passwd file */
if (user && pass && EQ(fields[2], "+")) {
! if ((pwd = getspnam(user)) == NULL)
continue;
! if (!EQ(pwd->sp_pwdp, crypt(pass, pwd->sp_pwdp)))
continue;
}
/* Matching for a specific user or just the host? */
--- 354,362 ----
/* 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;
}
/* Matching for a specific user or just the host? */
---end patch---
: I have not tried changing nsswitch.conf to be passwd_compat or
: whatever it is for using the old NIS way of plussing in users.
I don't think it would matter. Notice that the code uses the
getpwnam() function, which I believe specifically references the
/etc/passwd file.
--
Chris Bellomy Flashnet Communications
Senior System Administrator Fort Worth, Texas
cbellomy@flash.net (817)332-8878
Technical Details
Message-ID:
<5dvfin$k42@excalibur.flash.net>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:
<32F13DC5.4A06@documentum.com> <5ctp3a$623@excalibur.flash.net> <5diaop$1g6$2@cep7.u-paris10.fr> <5du909$5ib$2@darla.visi.com>Show Full Headers
Complete Article Headers
Message-ID: <5dvfin$k42@excalibur.flash.net> Subject: Re: Authorization and NNTP Date: Thu, 13 Feb 1997 00:00:00 +0000 From: cbellomy@flash.net (Chris Bellomy) References: <32F13DC5.4A06@documentum.com> <5ctp3a$623@excalibur.flash.net> <5diaop$1g6$2@cep7.u-paris10.fr> <5du909$5ib$2@darla.visi.com> 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: 218531962 Distribution: world Organization: Flashnet Communications, http://www.flash.net Newsgroups: news.software.nntp