Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cbmvax!snark!eric From: eric@snark.uu.net (Eric S. Raymond) Newsgroups: comp.sources.d Subject: Fixes to COPS for System V Message-ID: <1VsxRx#0yq2Xy7tQXc27J5hQQ9vdPgs=eric@snark.uu.net> Date: 23 Mar 90 21:42:54 GMT Lines: 147 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)