From 89eebb6927ca4f5983b72f5f59ff087edcfc3001 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 5 Aug 2004 02:02:33 +0000 Subject: [PATCH] * 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. --- citadel/ChangeLog | 6 ++++++ citadel/internet_addressing.c | 1 + citadel/serv_network.c | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 15ec569bc..ab9e69910 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 3e6d7bb55..576612795 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -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); diff --git a/citadel/serv_network.c b/citadel/serv_network.c index c73aea9a7..79210e22e 100644 --- a/citadel/serv_network.c +++ b/citadel/serv_network.c @@ -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; } -- 2.39.2