]> code.citadel.org Git - citadel.git/commitdiff
* Automatically add 127.0.0.1 and config.c_fqdn to public_clients
authorArt Cancro <ajc@citadel.org>
Fri, 11 Jul 2003 22:30:19 +0000 (22:30 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 11 Jul 2003 22:30:19 +0000 (22:30 +0000)
citadel/ChangeLog
citadel/citserver.c

index 816ce65934e17c849d5b9804491fabd97815d556..023fb7466a25afe37a286d858389d14d995e94df 100644 (file)
@@ -1,4 +1,7 @@
  $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
@@ -4842,4 +4845,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index dc082826301c9443fbc51d38c9ee5886d557f953..9960d66dc62e8e39c109819ba1852917851fffb7 100644 (file)
@@ -409,9 +409,11 @@ int is_public_client(void)
                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) {
@@ -422,9 +424,6 @@ int is_public_client(void)
                                if ((strlen(public_clients) +
                                   strlen(addrbuf) + 2)
                                   < sizeof(public_clients)) {
-                                       if (strlen(public_clients) != 0) {
-                                               strcat(public_clients, "|");
-                                       }
                                        strcat(public_clients, addrbuf);
                                }
                        }