$Log$
+ Revision 607.18 2003/07/11 22:30:19 ajc
+ * Automatically add 127.0.0.1 and config.c_fqdn to public_clients
+
Revision 607.17 2003/07/11 22:19:49 ajc
* is_public_client() now caches the IP addresses of all hosts in
the public_clients file, at server startup and whenever the file is
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
begin_critical_section(S_PUBLIC_CLIENTS);
lprintf(7, "Loading %s\n", PUBLIC_CLIENTS);
- strcpy(public_clients, "");
- /* FIXME add localhost */
- /* FIXME add config.c_fqdn */
+ strcpy(public_clients, "127.0.0.1");
+ if (hostname_to_dotted_quad(addrbuf, config.c_fqdn) == 0) {
+ strcat(public_clients, "|");
+ strcat(public_clients, addrbuf);
+ }
fp = fopen("public_clients", "r");
if (fp != NULL) while (fgets(buf, sizeof buf, fp)!=NULL) {
if ((strlen(public_clients) +
strlen(addrbuf) + 2)
< sizeof(public_clients)) {
- if (strlen(public_clients) != 0) {
- strcat(public_clients, "|");
- }
strcat(public_clients, addrbuf);
}
}