* CtdlHostAlias() now accepts "localhost" as a localhost address.
authorArt Cancro <ajc@citadel.org>
Thu, 5 Aug 2004 02:02:33 +0000 (02:02 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 5 Aug 2004 02:02:33 +0000 (02:02 +0000)
* working_ignetcfg is now loaded during incoming NETP commands, which
should theoretically take care of the missing config problem.

citadel/ChangeLog
citadel/internet_addressing.c
citadel/serv_network.c

index 15ec569bc372a0ecb08c1f3437014f26973d745e..ab9e699104c782efa039699f67b4bc7dcfe9b0b3 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 623.14  2004/08/05 02:02:33  ajc
+ * CtdlHostAlias() now accepts "localhost" as a localhost address.
+ * working_ignetcfg is now loaded during incoming NETP commands, which
+ should theoretically take care of the missing config problem.
+
  Revision 623.13  2004/08/02 02:51:03  ajc
  * utilsmenu: removed.  Because most of the admin functions have been moved
    into Citadel proper, what's left of this menu is now pathetic.
@@ -5956,3 +5961,4 @@ 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 3e6d7bb55f3c0675bfcdaa8d1c3ee5a61cc2ceb8..576612795bb604b221c03ade0c5de694181cc8a9 100644 (file)
@@ -75,6 +75,7 @@ int CtdlHostAlias(char *fqdn) {
 
        if (fqdn == NULL) return(hostalias_nomatch);
        if (strlen(fqdn) == 0) return(hostalias_nomatch);
+       if (!strcasecmp(fqdn, "localhost")) return(hostalias_localhost);
        if (!strcasecmp(fqdn, config.c_fqdn)) return(hostalias_localhost);
        if (!strcasecmp(fqdn, config.c_nodename)) return(hostalias_localhost);
        if (inetcfg == NULL) return(hostalias_nomatch);
index c73aea9a7cae84a027a7b4000695a9a8a27f8393..79210e22efe575f65843d756744197f32482184e 100644 (file)
@@ -1667,30 +1667,42 @@ void cmd_netp(char *cmdbuf)
 {
        char node[SIZ];
        char pass[SIZ];
+       int v;
 
        char secret[SIZ];
        char nexthop[SIZ];
 
        if (doing_queue) {
-               cprintf("%d spooling - try again in a few minutes\n", ERROR + RESOURCE_BUSY);
+               cprintf("%d spooling - try again in a few minutes\n",
+                       ERROR + RESOURCE_BUSY);
                return;
        }
 
+       /* Authenticate */
        extract(node, cmdbuf, 0);
        extract(pass, cmdbuf, 1);
 
-       if (is_valid_node(nexthop, secret, node) != 0) {
-               cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
+       /* Briefly load the IGnet Configuration to check node validity */
+       working_ignetcfg = CtdlGetSysConfig(IGNETCFG);
+       v = is_valid_node(nexthop, secret, node);
+       free(working_ignetcfg);
+       working_ignetcfg = NULL;
+
+       if (v != 0) {
+               cprintf("%d authentication failed\n",
+                       ERROR + PASSWORD_REQUIRED);
                return;
        }
 
        if (strcasecmp(pass, secret)) {
-               cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
+               cprintf("%d authentication failed\n",
+                       ERROR + PASSWORD_REQUIRED);
                return;
        }
 
        if (network_talking_to(node, NTT_CHECK)) {
-               cprintf("%d Already talking to %s right now\n", ERROR + RESOURCE_BUSY, node);
+               cprintf("%d Already talking to %s right now\n",
+                       ERROR + RESOURCE_BUSY, node);
                return;
        }