[news.software.nntp] more little tidbits to NNTP 1.5.9?

lear@turbo.bio.net (Eliot) (09/06/90)

I imagine this little change didn't get in before the beta test went
out...

If you want to use authentication, and you have existing logins for
things like UUCP that you might as well reuse, and you don't want to
mess with the login group of those users because we all know how uucp
is funny that way, this little fixit will check the group file.  It's
not smart enough to look for multiple lines, but rick will have to
make those changes if he wants that feature ;-)

*** auth.c.ORIG	Sat Jul 28 21:30:18 1990
--- auth.c	Sat Jul 28 21:47:19 1990
***************
*** 109,119 ****
  char *p;
  	{
  	static char pass[10];
! 	char *cp, *namep;
  	struct passwd *pwd;
  	struct group *grp;
  	int i;
  	int nntpgid;
  
  	strncpy(pass,p,8);
  	pass[8] = 0;
--- 109,121 ----
  char *p;
  	{
  	static char pass[10];
! 	char *cp, *namep,**curgrp;
  	struct passwd *pwd;
  	struct group *grp;
  	int i;
  	int nntpgid;
+ 	int  authfail=0;
+ 	
  
  	strncpy(pass,p,8);
  	pass[8] = 0;
***************
*** 127,134 ****
  	grp = getgrnam("nntp");
  
  	if (grp == NULL || pwd == NULL || namep == NULL
! 			|| strcmp(namep, pwd->pw_passwd)
! 			|| pwd->pw_gid != grp->gr_gid)
  		{
  #ifdef SYSLOG
  		syslog(LOG_ERR, "AUTHENTICATION ERROR");
--- 129,143 ----
  	grp = getgrnam("nntp");
  
  	if (grp == NULL || pwd == NULL || namep == NULL
! 	                || strcmp(namep, pwd->pw_passwd))
! 	  authfail++;
! 	
! 	if ( grp->gr_gid != pwd->pw_gid )
! 	  for (curgrp=grp->gr_mem; *curgrp != NULL; curgrp++)
! 	    if (!strcmp(*curgrp,User))
! 	      break;
! 
! 	if (authfail ||(*curgrp == NULL))
  		{
  #ifdef SYSLOG
  		syslog(LOG_ERR, "AUTHENTICATION ERROR");
-- 
Eliot Lear
[lear@turbo.bio.net]