home *** CD-ROM | disk | FTP | other *** search
- static char rcsid[] = "@(#)$Id: immune.c,v 2.1 07/23/90 jbc $";
- /***************************************************************************/
- /* Copyright (c) 1990 James B. Cummings, Jr. */
- /* */
- /* This program is offered in the Public Domain and is freely available */
- /* as long as this notice is kept intact with each module. */
- /***************************************************************************/
- #include "header.h"
-
- int
- immune(user)
- char **user;
- {
- FILE *imfp;
- char *name, s[22];
- char *lastc, *strchr();
- int ret;
-
- if((imfp = fopen(IMMUNE_FILE,"r")) < 0) {
- perror("immune.file");
- ret = 1;
- }
- else {
- while ((name = fgets(s,20,imfp)) != (char *)0) {
- if(lastc = strchr(name,'\n'));
- *lastc = '\0';
- if(strcmp(user,name) == 0) {
- ret = 1;
- break;
- }
- else ret = 0;
- }
- }
- (void) fclose(imfp);
- return(ret);
-
- }
-