* serv_network.c: Suppress Invalid node name for "." and ".."
authorMichael Hampton <io_error@uncensored.citadel.org>
Mon, 23 Aug 2004 21:34:28 +0000 (21:34 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Mon, 23 Aug 2004 21:34:28 +0000 (21:34 +0000)
citadel/ChangeLog
citadel/serv_network.c

index 36b005c6cb50851c409ebfd8c56b16c49d437275..adcaaaa8962c627ffa8ca53563f679c1a414bcc4 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 624.4  2004/08/23 21:34:28  error
+ * serv_network.c: Suppress Invalid node name for "." and ".."
+
  Revision 624.3  2004/08/16 04:19:14  ajc
  * newinstall.sh: more intelligent auto-run of setup programs
  * setup.c: change inittab question to be more newbie-friendly
@@ -5981,4 +5984,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 79210e22efe575f65843d756744197f32482184e..ed861e4bd9c0927d0abc0f12510f3da72d6a4d1f 100644 (file)
@@ -271,6 +271,7 @@ int is_valid_node(char *nexthop, char *secret, char *node) {
         * First try the neighbor nodes
         */
        if (working_ignetcfg == NULL) {
+               lprintf(CTDL_ERR, "working_ignetcfg is NULL!");
                if (nexthop != NULL) {
                        strcpy(nexthop, "");
                }
@@ -1324,6 +1325,8 @@ void network_purge_spoolout(void) {
        if (dp == NULL) return;
 
        while (d = readdir(dp), d != NULL) {
+               if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
+                       continue;
                snprintf(filename, sizeof filename,
                        "./network/spoolout/%s", d->d_name);
 
@@ -1673,6 +1676,7 @@ void cmd_netp(char *cmdbuf)
        char nexthop[SIZ];
 
        if (doing_queue) {
+               lprintf(CTDL_DEBUG, "spooling - try again in a few minutes");
                cprintf("%d spooling - try again in a few minutes\n",
                        ERROR + RESOURCE_BUSY);
                return;
@@ -1689,25 +1693,27 @@ void cmd_netp(char *cmdbuf)
        working_ignetcfg = NULL;
 
        if (v != 0) {
+               lprintf(CTDL_DEBUG, "authentication failed (node)");
                cprintf("%d authentication failed\n",
                        ERROR + PASSWORD_REQUIRED);
                return;
        }
 
        if (strcasecmp(pass, secret)) {
-               cprintf("%d authentication failed\n",
-                       ERROR + PASSWORD_REQUIRED);
+               lprintf(CTDL_DEBUG, "authentication failed (password)");
+               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);
+               lprintf(CTDL_DEBUG, "already talking to you");
+               cprintf("%d Already talking to %s right now\n", ERROR + RESOURCE_BUSY, node);
                return;
        }
 
        safestrncpy(CC->net_node, node, sizeof CC->net_node);
        network_talking_to(node, NTT_ADD);
+       lprintf(CTDL_DEBUG, "authenticated ok");
        cprintf("%d authenticated as network node '%s'\n", CIT_OK,
                CC->net_node);
 }