[comp.sources.d] Fixes to COPS for System V

eric@snark.uu.net (Eric S. Raymond) (03/24/90)

My apologies for posting these, but Dan Farmer left his @!&##$% mail address
off the COPS posting. Dan, I hope you're out there somwehere. NEXT TIME GIVE
US SOMEWHERE TO MAIL MODS!

*** filewriters.c~	Fri Mar 23 10:56:08 1990
--- filewriters.c	Fri Mar 23 11:12:40 1990
***************
*** 104,112 ****
  FILE	*out;
  int	gid;
  {
! 	struct	group	*grpent;
  	
! 	if ((grpent = getgrgid(gid)) == NULL)  {
  		fprintf(stderr, "Bad group id %d.\n", gid);
  		exit(1);
  		}
--- 104,113 ----
  FILE	*out;
  int	gid;
  {
! 	struct	group		*grpent;
! 	extern struct group	*getgrgid();
  	
! 	if ((grpent = getgrgid(gid)) == (struct group *)NULL)  {
  		fprintf(stderr, "Bad group id %d.\n", gid);
  		exit(1);
  		}
*** members.c~	Fri Mar 23 10:56:09 1990
--- members.c	Fri Mar 23 11:12:07 1990
***************
*** 25,35 ****
  	struct	group	*grent;
  	struct	passwd	*pwent;
  	char	**user;
  
  /*
   * Print the list of group members from /etc/group.
   */
! 	if ((grent = getgrnam(argv[1])) == NULL)  {
  		fprintf(stderr, "%s: Bad group name %s.\n",
  			argv[0], argv[1]);
  		exit(1);
--- 25,36 ----
  	struct	group	*grent;
  	struct	passwd	*pwent;
  	char	**user;
+ 	extern struct group	*getgrnam();
  
  /*
   * Print the list of group members from /etc/group.
   */
! 	if ((grent = getgrnam(argv[1])) == (struct group *)NULL)  {
  		fprintf(stderr, "%s: Bad group name %s.\n",
  			argv[0], argv[1]);
  		exit(1);
*** pass.c~	Fri Mar 23 10:56:10 1990
--- pass.c	Fri Mar 23 11:09:13 1990
***************
*** 185,197 ****
  	    clearerr(stdin);
  	    }
  	else {
! 	    if (setpwent(argv[i])) {
  		perror(argv[i]);
  		continue;
  		}
  	    Curpw = argv[i];
  	    chkpw();
! 	    endpwent();
  	    }
  	}
      if (!onedone) {
--- 185,197 ----
  	    clearerr(stdin);
  	    }
  	else {
! 	    if (csetpwent(argv[i])) {
  		perror(argv[i]);
  		continue;
  		}
  	    Curpw = argv[i];
  	    chkpw();
! 	    cendpwent();
  	    }
  	}
      if (!onedone) {
***************
*** 455,464 ****
  			/* altered to a reasonable number - mae 8/20/84 */
  
  /*
!  * Add a parameter to "setpwent" so I can override the file name.
   */
  
! setpwent(file)
  char *file;
  {
  	if ((pwf = fopen(file,"r")) == NULL)
--- 455,464 ----
  			/* altered to a reasonable number - mae 8/20/84 */
  
  /*
!  * Add a parameter to "csetpwent" so I can override the file name.
   */
  
! csetpwent(file)
  char *file;
  {
  	if ((pwf = fopen(file,"r")) == NULL)
***************
*** 466,473 ****
  	return(0);
  }
  
! endpwent()
! 
  {
      fclose(pwf);
      pwf = NULL;
--- 466,472 ----
  	return(0);
  }
  
! cendpwent()
  {
      fclose(pwf);
      pwf = NULL;
***************
*** 493,499 ****
  	long	x;
  
  	if(pwf == NULL)
! 	    if (setpwent(PASSWD)) {
  		perror(PASSWD);
  		return(NULL);
  		}
--- 492,498 ----
  	long	x;
  
  	if(pwf == NULL)
! 	    if (csetpwent(PASSWD)) {
  		perror(PASSWD);
  		return(NULL);
  		}
-- 
      Eric S. Raymond = eric@snark.uu.net    (mad mastermind of TMN-Netnews)

rsalz@bbn.com (Rich Salz) (03/27/90)

In <1VsxRx#0yq2Xy7tQXc27J5hQQ9vdPgs=eric@snark.uu.net> eric@snark.uu.net (Eric S. Raymond) writes:
>My apologies for posting these, but Dan Farmer left his @!&##$% mail address
>off the COPS posting. Dan, I hope you're out there somwehere. NEXT TIME GIVE
>US SOMEWHERE TO MAIL MODS!
You don't save the headers of things you archive from comp.sources.unix?

You should.
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.

molenda@cs.umn.edu (Jason "Hax R Us" Molenda) (03/29/90)

rsalz@bbn.com (Rich Salz) writes:

>In <1VsxRx#0yq2Xy7tQXc27J5hQQ9vdPgs=eric@snark.uu.net> eric@snark.uu.net (Eric S. Raymond) writes:
>>My apologies for posting these, but Dan Farmer left his @!&##$% mail address
>>off the COPS posting. Dan, I hope you're out there somwehere. NEXT TIME GIVE
>>US SOMEWHERE TO MAIL MODS!
>You don't save the headers of things you archive from comp.sources.unix?

>You should.
>-- 
>Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
>Use a domain-based address or give alternate paths, or you may lose out.

I missed the original article, so I'm following up to Rich's. 

From docs/COPS.report:

 Any improvements (that might not be too hard :-),
suggestions, or other security programs that
you would like to see get further distribution can be sent to:
.PP
df@medusa.cs.purdue.edu
.PP
(That's me)
.PP
or
.PP
spaf@uther.cs.purdue.edu
.PP
(Dr. Eugene Spafford)

which formats (roughly) as

Any improvements (that might not be too hard :-), suggestions, or other
security programs you would like to see get further distribution can be 
sent to:

   df@medusa.cs.purdue.edu

   (That's me)

   or

   spaf@uther.cs.purdue.edu

   (Dr. Eugene Spafford)

RTFM

Jason Molenda, University of Minnesota Csci dept
molenda@cs.umn.edu  || rutgers!umn-cs!molenda

df@cs.purdue.EDU (dan) (04/12/90)

>My apologies for posting these, but Dan Farmer left his @!&##$% mail address
>off the COPS posting. Dan, I hope you're out there somwehere. NEXT TIME GIVE
>US SOMEWHERE TO MAIL MODS!

  Sorry to get in on this conversation late, but feel free to send
any comments, mods, diffs, flames, whatever straight to me.  I've barely
gotten any response from the net, so I don't know if people are using COPS,
having problems with installation, want more features, or what.  I plan
on continuing work on it, so if you want to say something, now's the time....
  High on my list of things to do include:

   Better installation, configuration (do I hear Larry's Config calling?)
   An easy filtering mechanism to get rid of unwanted output
   More uucp, nfs, yp checks.
   And of course, crushing any bugs and eliminating as many port problems
	as possible.

  Also, I'd like to solicit responses on how people feel about a similar
tool to look for bugs (sendmail, etc.)  COPS II?

 -- thanks,

  dan

  df@sei.cmu.edu

-- 

dan
df@medusa.cs.purdue.edu

ggw@wolves.uucp (Gregory G. Woodbury) (04/13/90)

In article <10314@medusa.cs.purdue.edu> df@sei.cmu.edu (Dan Farmer) writes:
>  Sorry to get in on this conversation late, but feel free to send
>any comments, mods, diffs, flames, whatever straight to me.  I've barely
>gotten any response from the net, so I don't know if people are using COPS,
>having problems with installation, want more features, or what.  I plan
>on continuing work on it, so if you want to say something, now's the time....
>  High on my list of things to do include:
>
>   Better installation, configuration (do I hear Larry's Config calling?)
>   An easy filtering mechanism to get rid of unwanted output
>   More uucp, nfs, yp checks.
>   And of course, crushing any bugs and eliminating as many port problems
>	as possible.
>
>  Also, I'd like to solicit responses on how people feel about a similar
>tool to look for bugs (sendmail, etc.)  COPS II?
>  df@sei.cmu.edu
>df@medusa.cs.purdue.edu

	I have attempted to use it on 386/ix v2.0.1.  I compiles with only
minimal fixes to the makefile, but it just won't run.  Some piece dumps core
and leaves no trace.  Another piece runs forever without producing anything.
Given the press of time, I have read through the code somewhat and have 
checked several things by hand.

	Thanks for the effort, it looks like a good concept.
-- 
Gregory G. Woodbury @ The Wolves Den UNIX, Durham NC
UUCP: ...dukcds!wolves!ggw   ...mcnc!wolves!ggw           [use the maps!]
Domain: ggw@cds.duke.edu     ggw%wolves@mcnc.mcnc.org
[The line eater is a boojum snark! ]           <standard disclaimers apply>