Parses the static entries from hosts
pulls the static entries and stores them in the tmp filestable
parent
89a122ed16
commit
4789384846
14
src/rhosts.c
14
src/rhosts.c
|
|
@ -120,6 +120,20 @@ int preserve_static_entries(){
|
||||||
fclose(hostsf);
|
fclose(hostsf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
char buff[MAXSTRSIZE];
|
||||||
|
char c = EOF;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
do{
|
||||||
|
c = fgetc(hostsf);
|
||||||
|
printf("%c",c);
|
||||||
|
strncat(buff, &c, 1);
|
||||||
|
if (strncmp(buff, "# rhosts begin", 14) == 0){c = EOF;}
|
||||||
|
if (c == '\n'){
|
||||||
|
rc = fputs(buff, tmpf);
|
||||||
|
buff[0] = '\0';
|
||||||
|
}
|
||||||
|
}while ( c != EOF);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue