scraping the bits away
authorArt Cancro <ajc@citadel.org>
Tue, 23 Jan 2018 03:19:51 +0000 (22:19 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 23 Jan 2018 03:19:51 +0000 (22:19 -0500)
citadel/Makefile.in
citadel/include/citadel_dirs.h
citadel/modules/ctdlproto/serv_file.c
citadel/modules/network/serv_netspool.c
citadel/modules/network/serv_network.c
citadel/utillib/citadel_dirs.c
citadel/utils/aidepost.c [deleted file]

index c71cb9ed74cb81323562023b0f8212c1a778f9d3..24bb68f4e0feaa3e801307d14fdb93ad55a0e1b5 100644 (file)
@@ -38,7 +38,7 @@ UTIL_TARGETS=citmail$(EXEEXT) sendcommand$(EXEEXT)
 
 UTILBIN_TARGETS= base64$(EXEEXT) setup$(EXEEXT) \
        chkpw$(EXEEXT) chkpwd$(EXEEXT) \
-       aidepost$(EXEEXT) msgform$(EXEEXT) \
+       msgform$(EXEEXT) \
        ctdlmigrate$(EXEEXT)
 
 
@@ -70,7 +70,7 @@ LOCALEDIR=@LOCALEDIR@
 .SILENT:
 
 
-SOURCES=utils/aidepost.c utils/citmail.c \
+SOURCES=utils/citmail.c \
        utils/setup.c utils/msgform.c utils/chkpw.c \
        utils/sendcommand.c \
        utils/ctdlmigrate.c utils/base64.c utils/chkpwd.c \
@@ -145,10 +145,6 @@ citserver$(EXEEXT): $(SERV_OBJS)
        echo "CC $<"
        $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $< -o $@
 
-aidepost$(EXEEXT): utils/aidepost.o utillib/citadel_dirs.o
-       $(CC) utils/aidepost.o utillib/citadel_dirs.o \
-               $(LDFLAGS) -o aidepost$(EXEEXT) $(LIBS)
-
 citmail$(EXEEXT): utils/citmail.o utillib/citadel_dirs.o
        $(CC) utils/citmail.o utillib/citadel_dirs.o \
                $(LDFLAGS) -o citmail$(EXEEXT) $(LIBS)
index 6ce044eed92205d0107178efd1f791a882b7de9b..9cde767d088ae190fa20347286768164fbb7e617 100644 (file)
@@ -22,7 +22,6 @@ extern char ctdl_autoetc_dir[PATH_MAX];
 extern char ctdl_run_dir[PATH_MAX];
 extern char ctdl_spool_dir[PATH_MAX];
 extern char ctdl_netout_dir[PATH_MAX];
-extern char ctdl_netin_dir[PATH_MAX];
 extern char ctdl_netdigest_dir[PATH_MAX];
 extern char ctdl_nettmp_dir[PATH_MAX];
 extern char ctdl_netcfg_dir[PATH_MAX];
index f412b259e221644433565381f442180409dfa5e3..44a5d361315086007d9b0a1cd7c1c37208921432 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Server functions which handle file transfers and room directories.
  *
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -407,28 +407,6 @@ void cmd_ucls(char *cmd)
        fclose(CC->upload_fp);
        CCC->upload_fp = NULL;
 
-       if ((!strcasecmp(cmd, "1")) && (CCC->upload_type != UPL_FILE)) {
-               cprintf("%d Upload completed.\n", CIT_OK);
-
-               if (CCC->upload_type == UPL_NET) {
-                       char final_filename[PATH_MAX];
-                       snprintf(final_filename, sizeof final_filename, "%s/%s.%04lx.%04x", ctdl_netin_dir, CCC->net_node, (long)getpid(), ++seq);
-
-                       if (link(CCC->upl_path, final_filename) == 0) {
-                               syslog(LOG_INFO, "serv_file: ucls updoaded %s", final_filename);
-                               unlink(CCC->upl_path);
-                       }
-                       else {
-                               syslog(LOG_INFO, "serv_file: cannot link %s to %s: %s",
-                                           CCC->upl_path, final_filename, strerror(errno)
-                               );
-                       }
-               }
-
-               CCC->upload_type = UPL_FILE;
-               return;
-       }
-
        if (!strcasecmp(cmd, "1")) {
                cprintf("%d File '%s' saved.\n", CIT_OK, CCC->upl_path);
                fp = fopen(CCC->upl_filedir, "a");
index 0366181236cf8af8ee19465eb5a9398b0b6f572e..7ec783c9620019a3eb73a94c0946137bacde8af3 100644 (file)
@@ -769,10 +769,6 @@ void create_spool_dirs(void) {
                syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_spool_dir, strerror(errno));
        if (chown(ctdl_spool_dir, CTDLUID, (-1)) != 0)
                syslog(LOG_EMERG, "netspool: unable to set the access rights for [%s]: %s", ctdl_spool_dir, strerror(errno));
-       if ((mkdir(ctdl_netin_dir, 0700) != 0) && (errno != EEXIST))
-               syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_netin_dir, strerror(errno));
-       if (chown(ctdl_netin_dir, CTDLUID, (-1)) != 0)
-               syslog(LOG_EMERG, "netspool: unable to set the access rights for [%s]: %s", ctdl_netin_dir, strerror(errno));
        if ((mkdir(ctdl_nettmp_dir, 0700) != 0) && (errno != EEXIST))
                syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_nettmp_dir, strerror(errno));
        if (chown(ctdl_nettmp_dir, CTDLUID, (-1)) != 0)
index eb7941d0022987b71673abc31099ce325004e28a..0b77b359dc6304846e00edd052ee3100aecdc4af 100644 (file)
@@ -438,78 +438,6 @@ void network_cleanup_function(void)
 }
 
 
-int ignet_aftersave(struct CtdlMessage *msg, recptypes *recps)
-{
-       /* For IGnet mail, we have to save a new copy into the spooler for
-        * each recipient, with the R and D fields set to the recipient and
-        * destination-node.  This has two ugly side effects: all other
-        * recipients end up being unlisted in this recipient's copy of the
-        * message, and it has to deliver multiple messages to the same
-        * node.  We'll revisit this again in a year or so when everyone has
-        * a network spool receiver that can handle the new style messages.
-        */
-       if ((recps != NULL) && (recps->num_ignet > 0))
-       {
-               char *recipient;
-               int rv = 0;
-               struct ser_ret smr;
-               FILE *network_fp = NULL;
-               char submit_filename[128];
-               static int seqnum = 1;
-               int i;
-               char *hold_R, *hold_D, *RBuf, *DBuf;
-               long hrlen, hdlen, rblen, dblen, count, rlen;
-               CitContext *CCC = MyContext();
-
-               CM_GetAsField(msg, eRecipient, &hold_R, &hrlen);;
-               CM_GetAsField(msg, eDestination, &hold_D, &hdlen);;
-
-               count = num_tokens(recps->recp_ignet, '|');
-               rlen = strlen(recps->recp_ignet);
-               recipient = malloc(rlen + 1);
-               RBuf = malloc(rlen + 1);
-               DBuf = malloc(rlen + 1);
-               for (i=0; i<count; ++i) {
-                       extract_token(recipient, recps->recp_ignet, i, '|', rlen + 1);
-
-                       rblen = extract_token(RBuf, recipient, 0, '@', rlen + 1);
-                       dblen = extract_token(DBuf, recipient, 1, '@', rlen + 1);
-               
-                       CM_SetAsField(msg, eRecipient, &RBuf, rblen);;
-                       CM_SetAsField(msg, eDestination, &DBuf, dblen);;
-                       CtdlSerializeMessage(&smr, msg);
-                       if (smr.len > 0) {
-                               snprintf(submit_filename, sizeof submit_filename,
-                                        "%s/netmail.%04lx.%04x.%04x",
-                                        ctdl_netin_dir,
-                                        (long) getpid(),
-                                        CCC->cs_pid,
-                                        ++seqnum);
-
-                               network_fp = fopen(submit_filename, "wb+");
-                               if (network_fp != NULL) {
-                                       rv = fwrite(smr.ser, smr.len, 1, network_fp);
-                                       if (rv == -1) {
-                                               syslog(LOG_EMERG, "network: CtdlSubmitMsg() Couldn't write network spool file: %s", strerror(errno));
-                                       }
-                                       fclose(network_fp);
-                               }
-                               free(smr.ser);
-                       }
-                       CM_GetAsField(msg, eRecipient, &RBuf, &rblen);;
-                       CM_GetAsField(msg, eDestination, &DBuf, &dblen);;
-               }
-               free(RBuf);
-               free(DBuf);
-               free(recipient);
-               CM_SetAsField(msg, eRecipient, &hold_R, hrlen);
-               CM_SetAsField(msg, eDestination, &hold_D, hdlen);
-               return 1;
-       }
-       return 0;
-}
-
-
 /*
  * Module entry point
  */
@@ -519,7 +447,6 @@ CTDL_MODULE_INIT(network)
 {
        if (!threading)
        {
-               CtdlRegisterMessageHook(ignet_aftersave, EVT_AFTERSAVE);
                CtdlFillSystemContext(&networker_spool_CC, "CitNetSpool");
                CtdlRegisterSessionHook(network_cleanup_function, EVT_STOP, PRIO_STOP + 30);
                 CtdlRegisterSessionHook(network_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 10);
index 2d5dd7b2e6869dc602c3c87489d3d10d822e0b57..dca1e3d61985614f1071d60275514ecd3a278c27 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * citadel_dirs.c : calculate pathnames for various files used in the Citadel system
  *
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 3.
@@ -42,7 +42,6 @@ char ctdl_autoetc_dir[PATH_MAX]="";
 char ctdl_run_dir[PATH_MAX]="";
 char ctdl_spool_dir[PATH_MAX]="network";
 char ctdl_netout_dir[PATH_MAX]="network/spoolout";
-char ctdl_netin_dir[PATH_MAX]="network/spoolin";
 char ctdl_netdigest_dir[PATH_MAX]="network/digest";
 char ctdl_nettmp_dir[PATH_MAX]="network/spooltmp";
 char ctdl_netcfg_dir[PATH_MAX]="netconfigs";
@@ -176,13 +175,11 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char  *ctdldir,
 #endif
        COMPUTE_DIRECTORY(ctdl_spool_dir);
        COMPUTE_DIRECTORY(ctdl_netout_dir);
-       COMPUTE_DIRECTORY(ctdl_netin_dir);
        COMPUTE_DIRECTORY(ctdl_netdigest_dir);
        COMPUTE_DIRECTORY(ctdl_nettmp_dir);
 
        StripSlashes(ctdl_spool_dir, 1);
        StripSlashes(ctdl_netout_dir, 1);
-       StripSlashes(ctdl_netin_dir, 1);
        StripSlashes(ctdl_netdigest_dir, 1);
        StripSlashes(ctdl_nettmp_dir, 1);
 
@@ -296,7 +293,6 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char  *ctdldir,
        DBG_PRINT(ctdl_run_dir);
        DBG_PRINT(ctdl_spool_dir);
        DBG_PRINT(ctdl_netout_dir);
-       DBG_PRINT(ctdl_netin_dir);
        DBG_PRINT(ctdl_netdigest_dir);
        DBG_PRINT(ctdl_nettmp_dir);
        DBG_PRINT(ctdl_netcfg_dir);
@@ -406,7 +402,6 @@ int create_run_directories(long UID, long GID)
        rv += create_dir(ctdl_file_dir      , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
        rv += create_dir(ctdl_spool_dir     , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
        rv += create_dir(ctdl_netout_dir    , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
-       rv += create_dir(ctdl_netin_dir     , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
        rv += create_dir(ctdl_netdigest_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
        rv += create_dir(ctdl_nettmp_dir    , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
        rv += create_dir(ctdl_key_dir       , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1);
diff --git a/citadel/utils/aidepost.c b/citadel/utils/aidepost.c
deleted file mode 100644 (file)
index 43203a2..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * This is just a little hack to copy standard input to a message in Aide>
- *
- * Copyright (c) 1987-2012 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
-#include <time.h>
-#include "citadel.h"
-#include "citadel_dirs.h"
-
-/*
- * Simplified function to generate a message in our format
- */
-static void ap_make_message(FILE *fp, char *target_room, char *author, char *subject)
-{
-       int a;
-       long bb, cc;
-       time_t now;
-       time(&now);
-       putc(255, fp);
-       putc(MES_NORMAL, fp);
-       putc(1, fp);
-       fprintf(fp, "Proom_aide");
-       putc(0, fp);
-       fprintf(fp, "T%ld", (long)now);
-       putc(0, fp);
-       fprintf(fp, "A%s", author);
-       putc(0, fp);
-       fprintf(fp, "O%s", target_room);
-       putc(0, fp);
-       if (strlen(subject) > 0) {
-               fprintf(fp, "U%s%c", subject, 0);
-       }
-       putc('M', fp);
-       bb = ftell(fp);
-       while (a = getc(stdin), a > 0) {
-               if (a != 8)
-                       putc(a, fp);
-               else {
-                       cc = ftell(fp);
-                       if (cc != bb)
-                               fseek(fp, (-1L), 1);
-               }
-       }
-       putc(0, fp);
-       putc(0, fp);
-       putc(0, fp);
-}
-
-
-int main(int argc, char **argv)
-{
-       char tempspool[64];
-       char target_room[ROOMNAMELEN];
-       char author[64];
-       char subject[256];
-       FILE *tempfp, *spoolfp;
-       int ch;
-       int i;
-       int relh=0;
-       int home=0;
-       char relhome[PATH_MAX]="";
-       char ctdldir[PATH_MAX]=CTDLDIR;
-
-       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
-
-       strcpy(target_room, "Aide");
-       strcpy(author, "Citadel");
-       strcpy(subject, "");
-       for (i=1; i<argc; ++i) {
-               if (!strncasecmp(argv[i], "-r", 2)) {
-                       strncpy(target_room, &argv[i][2], sizeof(target_room));
-                       target_room[sizeof(target_room)-1] = 0;
-               }
-               else if (!strncasecmp(argv[i], "-a", 2)) {
-                       strncpy(author, &argv[i][2], sizeof(author));
-                       author[sizeof(author)-1] = 0;
-               }
-               else if (!strncasecmp(argv[i], "-s", 2)) {
-                       strncpy(subject, &argv[i][2], sizeof(subject));
-                       subject[sizeof(subject)-1] = 0;
-               } else {
-                       fprintf(stderr, "%s: usage: %s "
-                                       "[-rTargetRoom] [-aAuthor] [-sSubject]\n",
-                               argv[0], argv[0]);
-                       exit(1);
-               }
-       }
-
-       snprintf(tempspool, sizeof tempspool, "%s/ap.%04x.%08lx", ctdl_netin_dir, getpid(), time(NULL));
-       unlink(tempspool);      /* unlinking it for now, keeps it from being posted prematurely */
-
-       tempfp = fopen(tempspool, "w+b");
-       unlink(tempspool);
-       if (tempfp == NULL) {
-               perror("cannot open temp file");
-               exit(errno);
-       }
-
-       /* Generate a message from stdin */
-       ap_make_message(tempfp, target_room, author, subject);
-
-       /* Copy it to a new temp file in the spool directory */
-       rewind(tempfp);
-
-       spoolfp = fopen(tempspool, "wb");
-       if (spoolfp == NULL) {
-               perror("cannot open spool file");
-               exit(errno);
-       }
-       while (ch = getc(tempfp), (ch >= 0)) {
-               putc(ch, spoolfp);
-       }
-
-       fclose(tempfp);
-       return(fclose(spoolfp));
-}